Is is possible to suppress 'ans' in MATLAB? -


this question has answer here:

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

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -