Displaying Data From a MATLAB Function

I have a MATLAB Function embedded in a simulation that is called cyclically. I would like to display information from that function as the simulation runs. I tried both disp() and fprint() but the information does not appear in the Command Window as the simulation runs. I verified that it hits the display lines by using a debug break. disp() lines that are placed in various .m files that initialize and start the simulation all appear as expected in the Command Window, just not those that are in the cycling MATLAB Function.

2 Comments

I think the issue might be the stdout is dropped or flushed to somewhere else since it is called in a simulation. While I don't have much idea over that, you can simply save what shall be printed in your fprintf() function into a txt file locally and check that file you wrote after you've finished your simulation.
I suspect you are right about stdout. I did a little research on that but didn't find a smoking gun. I'm sure I used to do this all the time without issue, but something seems to have changed or I've forgotten something about the process that makes it work. Thanks for the recommendation to just log the data and review it post-Simulation.

Sign in to comment.

Answers (0)

Products

Release

R2017a

Tags

Asked:

Tom
on 18 Jul 2018

Commented:

Tom
on 19 Jul 2018

Community Treasure Hunt

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

Start Hunting!