How to display values from and embedded matlab function in stateflow
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Kaustubha Govind
il 8 Apr 2013
Are you able to explicitly print the values of the variables using DISP, or set breakpoints in the Embedded MATLAB Function?
Risposte (1)
Siddharth
il 8 Apr 2013
Modificato: Siddharth
il 14 Apr 2013
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
0 Commenti
Vedere anche
Categorie
Scopri di più su Complex Logic in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!