フィルターのクリア

How to display values from and embedded matlab function in stateflow

1 回表示 (過去 30 日間)
Joe
Joe 2013 年 4 月 5 日
Hi everyone,
I have recently been given a project that requires the use of an embedded matlab function within a stateflow chart. I have successfully created my program and debugged all parse errors but I am getting different numerical values if I run my program within and outside stateflow. Normally I would suppress the semi-colon on the line in question but when I tried this the value did not display on the screen. It was suggested to me that I change the output of my embedded matlab function to the variable in question and display that but I cannot do this as the stateflow chart fails to run (it needs the variable I am currently outputting for the rest of the chart to work).
I was wondering if there are any ways to display results from lines of code in an embedded matlab function that resides in a stateflow chart? Any help would be greatly appreciated.
Thanks,
Joe
  1 件のコメント
Kaustubha Govind
Kaustubha Govind 2013 年 4 月 8 日
Are you able to explicitly print the values of the variables using DISP, or set breakpoints in the Embedded MATLAB Function?

サインインしてコメントする。

回答 (1 件)

Siddharth
Siddharth 2013 年 4 月 8 日
編集済み: Siddharth 2013 年 4 月 14 日
Adding to Kaustubha's comment, check the inputs to the function by placing a breakpoint on the first line of the MATLAB function and then executing the Stateflow chart. Find more information about breakpoints here: http://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html#brqxeeu-182
If the input to the chart is not what you expect, check the simulation times at which the function is called. To do that, use breakpoints in the Stateflow chart. If you are using R2012b, find more about how to do this in the video below: http://www.mathworks.com/videos/integrated-debugger-70058.html

カテゴリ

Help Center および File ExchangeComplex Logic についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by