How to debug a Simulink model that is called from Matlab

조회 수: 3 (최근 30일)
Naga K
Naga K 2024년 5월 10일
답변: Fangjun Jiang 2024년 5월 10일
I am working on documenting a Matlab + Simulink code which was written by someone else.
I have no problem understanding the Matlab code by Running the code using the "Step In" option available in Matlab .
The issue I have is, when matlab transfers control from Matlab file to Simulink, using the function call "sim(model_name,parameters)"
When I continue the "Step In" after the program control gets transferred to Simulink, Matlab opens "fullfile.m" instead of the Simulink blocks
How do I "Step In" each block of Simulink when the program control gets transferred to simulink ?

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2024년 5월 10일
This would be difficult. If you do need to debug any issue with the Simulink model simulation, I would suggest you do it separately with the Simulink model.
Open the Simulink model, Click "Debug" at the top menu tab. You can trace signal values, add break point, run step by step, etc. But it will be different than debugging code line by line.
Once you resolved the issues with the Simulink model and make sure the simulation is correct, then focused on debugging the MATLAB code.

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by