Reputation: 13
How do I display the current value of a variable in the matlab command window? In matlab I usually use disp(var)
and it will output the variable value into the command window. However in the MATLAB function block if I were to enter disp('hello')
it doesn't show any output in the command window. I am using matlab 2014b.
Upvotes: 1
Views: 795
Reputation: 595
You idea for displaying output value in the command window is not a good approach to solve your issue. I would suggest you look at scope block
if you'd like to see the value during simulation. Or use To Wrokspace
block if you'd like to output the value into main workspace.
For debugging your code and design, read and use Simulink Debugger should be helpful.
Upvotes: 1