Is is possible to suppress 'ans' in MATLAB? -
this question has answer here:
- suppressing output matlab 1 answer
i have function, not want ans = ... in end. possible suppress it?
for instance:
function c = example (b) c = b + 2; end on command window:
>>example (8) >>ans = 10
put semicolon @ end of line function called. here's bit of documentation covers this.
from symbol reference:
output suppression
when placed @ end of command, semicolon tells matlab not display output command. in example, matlab not display resulting 100-by-100 matrix:
a = ones(100, 100);
this pertains display. afaik, there's no way prevent matlab still assigning ans (i.e. rand; still assigns result ans).
Comments
Post a Comment