When a Matlab function block running inside a simulink model gives an error, how can I find out which line the error occurred on?
古いコメントを表示
When running a Simulink model that contains an "Interpreted Matlab Function" block, if an error occurs inside the Matlab function there seems to be no easy way to find out what line of the function gave the error. When the error occurs, a Simulink Diagnostics window pops up telling me what error occurred and which block it occurred in. But is doesn't say what line of the function caused the error.
This is a problem I encounter frequently, and it is difficult to debug. For instance, it just occurred about a half hour into a simulation. What I'll probably do is start outputting a bunch of values to the command window so I can get an idea where in the function the error occurred, but I can take a very long time to find the error this way when it occurs far along in the simulation.
It seems like Matlab must know what line caused the error, right? How can I get it to tell me?
Thanks for any help!
採用された回答
その他の回答 (2 件)
David Sanchez
2013 年 5 月 31 日
0 投票
3 件のコメント
Anderson
2013 年 5 月 31 日
David Sanchez
2013 年 5 月 31 日
For what you say, it seems your code has to be right, does any signal become complex during runtime? What messages do you receive from simulink?
Anderson
2013 年 5 月 31 日
カテゴリ
ヘルプ センター および File Exchange で Sources についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!