I took a look at a similar question , but the answer as well as the linked question within didn't match my exact problem.
Assume, that I have several Matlab files that are executed by a program. During the execution of the code, I receive multiple outputs in the command window, which I want to get rid of. Of course, I could just grep all disp and printf commands, no problem. However, there is also the possibility, that certain computations print something without Matlab giving me a warning for a missing semicolon. An example would be
function dummy1
norm(1)
end
Which would print 1 to the command window, but Matlab does not give me a warning for a missing semicolon as it would be the case for
function dummy2
1+1
end
Is there a way to detect the position of the command that prints to command window?
evalcto suppress all output to the command line in the first place. This way you can call your main function likeevalc('main.m');. Note thatdiary,moreandinputare disabled when usingevalc. This does not answer your question but solves your initial problem. - Matt