MATLAB: How to get a program to display something from a function

displayfunction

Is there a way to display something from a function when running a program?

Best Answer

Remove the semicolon at the end of
counter = counter + 1
The value of 'counter' will then display every time it's updated.
A more visually appealing method is to use fprintf
count = counter + 1;
fprintf('count = %d\n', count);