본문으로 건너뛰기
cccskills
무료GitHub에 공개

matlab-codegen-deploy

MATLAB R2026a code generation and deployment workflow for MATLAB Coder, Simulink Coder, Embedded Coder, GPU Coder, HDL Coder, fixed-point conversion, MEX validation, and embedded deployment readiness. Use whenever the user asks to generate C/C++/CUDA/HDL/code, deploy algorithms, or validate generated code.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md4.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

MATLAB Codegen Deploy

Use this skill when MATLAB or Simulink algorithms need to become generated code or deployable artifacts.

Workflow

  1. Identify target: MEX, C/C++, embedded C, CUDA, HDL, PLC, or packaged app.
  2. Verify required products with ver and license.
  3. Isolate the algorithm into a codegen-friendly function.
  4. Define input types with coder.typeof or representative test vectors.
  5. Generate the smallest artifact first, usually MEX.
  6. Compare generated result against MATLAB golden output.
  7. Save generated code, logs, reports, and validation metrics.

Self-Compile and Verify Preference

The user expects generated MATLAB/Simulink work to compile and verify itself after writing. Do not stop at source generation when a build or smoke check is feasible:

  1. For MATLAB Coder, run codegen and then compare generated/MEX output against MATLAB golden output when compiler support exists.
  2. For Simulink Coder, update/compile the model first, run simulation, then call slbuild only after simulation passes.
  3. For embedded targets such as STM32, first try the configured hardware target and toolchain; if it fails, capture the exact missing package/compiler message and generate the closest portable C fallback if possible.
  4. Verify generated .c, .h, project, library, elf/axf/hex/bin, or fallback artifacts exist and are nonempty.
  5. Report clearly which stage passed: model update, simulation, code generation, toolchain build, binary generation, or only portable fallback.

MATLAB Coder Pattern

Use this pattern before larger deployment:

cfg = coder.config("mex");
codegen -config cfg myFunction -args {coder.typeof(0,[100 1],[1 0])}
gold = myFunction(x);
actual = myFunction_mex(x);
assert(norm(gold-actual) < 1e-9)

Embedded Readiness

Check:

  • Fixed-size vs variable-size arrays.
  • Dynamic allocation and recursion.
  • Unsupported functions.
  • Numeric overflow and fixed-point scaling.
  • Stack and heap impact.
  • Timing budget and hardware target assumptions.

Simulink Codegen

For models:

  • Update/compile the model after editing and before slbuild.
  • Build only after simulation passes.
  • Set solver and sample times explicitly.
  • Run Model Advisor or relevant checks when available.
  • Compare simulation outputs before and after code generation.

STM32 Embedded Coder Readiness

For STM32 targets, do not treat "an executable exists on disk" as enough. Verify the full MATLAB-to-ST chain before blaming the model:

  • MATLAB products: Simulink, Simulink Coder, Embedded Coder, STM32 support package.
  • MATLAB registration: stm32cube.hwsetup.stm32Tools.getInstalledSTM32CubeMX() returns the CubeMX directory MATLAB will use.
  • ST tools: GNU Tools for STM32, CMSIS, CMSIS-DSP, STM32CubeMX, and the matching STM32Cube firmware package such as STM32Cube_FW_F1_*.
  • Model binding: the model has a real .ioc path in STM32CubeMX.ProjectFile.
  • Target hardware: codertarget.targethardware.getRegisteredTargetHardwareNames includes the required STM32 family, for example STM32F1xx Based.

Prefer target data APIs over editing opaque structures:

tools = stm32cube.hwsetup.stm32Tools();
tools.updateSTM32CubeMXPath("C:\Users\me\AppData\Local\Programs\STM32CubeMX");

codertarget.data.setParameterValue(model, "STM32CubeMX.ProjectFile", iocPath);
codertarget.data.setParameterValue(model, "STM32CubeMX.DeviceId", "STM32F103RBTx");
codertarget.data.setParameterValue(model, "STM32CubeMX.Family", "STM32F1");

If slbuild hangs around "Generating code from STM32CubeMX project" or "Starting compilation process":

  • Check STM32CubeMX.log, generated hardware scripts, and background java.exe / STM32CubeMX.exe processes.
  • Compare direct STM32CubeMX.exe -q script with MATLAB's java -jar STM32CubeMX.exe -q script; some CubeMX versions can behave differently.
  • Prefer the MathWorks-recommended CubeMX version shown by message("stm32:setup:CubeMXReqVersion").getString.
  • If non-ASCII paths are involved, copy the model and .ioc to an ASCII scratch path and retry once to isolate path encoding from model errors.
  • Only use a local CubeMX wrapper as a documented workaround after recording the direct failure and the real CubeMX path.

Output

Report target, generated artifact path, report path, golden comparison result, and limitations.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

MATLAB R2026a workflow for control systems, system identification, robust control, MPC, Simulink Control Design, parameter tuning, constrained optimization, and numerical validation. Use whenever the user asks for controllers, transfer functions, state-space models, tuning, identification, optimal control, or solver-based engineering.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

wzyn20051216/matlab-agent-skills262026년 10월 18일 업데이트

MATLAB R2026a data analysis workflow for tables, timetables, statistics, fitting, optimization-assisted analysis, visualization, report artifacts, and reproducible paper figures. Use whenever the user asks MATLAB to analyze data, plot results, fit models, process CSV/Excel/MAT files, or reproduce figures.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

wzyn20051216/matlab-agent-skills262026년 10월 18일 업데이트

MATLAB R2026a agentic workflow router. Use this whenever the user asks for MATLAB, Simulink, .m/.mlx/.slx work, toolbox-driven engineering, paper reproduction, simulation, code generation, data analysis, control, robotics, signal/image/AI workflows, or wants an end-to-end automated MATLAB task with validation. For Simulink tasks on this machine, default to a visible workflow: open MATLAB/Simulink windows first so the user can watch modeling, simulation, tuning, and plotting progress.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

wzyn20051216/matlab-agent-skills262026년 10월 18일 업데이트

MATLAB R2026a robotics and autonomy workflow for ROS Toolbox, Robotics System Toolbox, Navigation Toolbox, UAV Toolbox, sensor fusion, trajectory planning, simulation, and reproducible robot experiments. Use for ROS/ROS 2 bags, robot models, path planning, SLAM, state estimation, and autonomy prototyping.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

wzyn20051216/matlab-agent-skills262026년 10월 18일 업데이트

Run MATLAB R2026a tasks from Codex with reliable MCP-based execution, logs, artifacts, toolbox inventory, smoke tests, and reproducible validation. Use whenever MATLAB code, .m/.mlx scripts, MATLAB tests, local toolbox probing, or command-line automation is needed.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

wzyn20051216/matlab-agent-skills262026년 10월 18일 업데이트

MATLAB R2026a workflow for signal processing, DSP, image processing, computer vision, lidar, medical imaging, deep learning, and AI-assisted reproducible experiments. Use for filters, spectrograms, wavelets, object detection, segmentation, classification, training, inference, and generated figures.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

wzyn20051216/matlab-agent-skills262026년 10월 18일 업데이트

wzyn20051216의 스킬 모두 보기

이 스킬의 문제 신고