Displaying Data From a MATLAB Function
Show older comments
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
Albert Fan
on 18 Jul 2018
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.
Tom
on 19 Jul 2018
Answers (0)
Categories
Find more on Code Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!