Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

matlab - Suppress Output

I want to suppress the output of variables in a set of Matlab functions. The problem is that the author forget the ";" at many positions in the code. For debug purpose this output is useful but now I want to suppress it, without searching the whole code for the missing ";". Is there a possibility to turn off this kind of output?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can suppress the output using evalc, but this requires you to pass your expression in as a string. For instance if you were using:

[A,B,C] = notMyFunction(d,e,f);

You can use instead

[T,A,B,C] = evalc('notMyFunction(d,e,f);');

And any output that would have gone to the console will now be buffered and stored in T.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...