Prevent function from printing to command window?
27 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Blenndrman
am 18 Sep. 2019
Kommentiert: Walter Roberson
am 3 Okt. 2019
Right now, I'm running simulations and fitting routines that repeatedly call a series of functions that I've downloaded but are not open-source (i.e. I can't edit or see how they work, although they are free to use, written specifically for Matlab, and available for anyone). Each of these functions prints comments to the command window almost every time it runs, which, I'm fairly certain, is slowing my simulations considerably. Is there some way of preventing a Matlab script or function from printing to the command window at all, and is this faster?
Briefly, I'll note that using a semicolon to suppress is not what I'm talking about – that's not the solution (FWIW I'm already doing this).
2 Kommentare
Geoff Hayes
am 18 Sep. 2019
Brendan - do any of these functions allow an input to suppress the output? Can you provide a link to the code that you are using?
Akzeptierte Antwort
Daniel M
am 3 Okt. 2019
Bearbeitet: Daniel M
am 3 Okt. 2019
doc evalc
1 Kommentar
Walter Roberson
am 3 Okt. 2019
Yes, this should work. evalc() captures output that would normally go to the command window.
Note that it will capture everything, so if there are some parts you want to see as they happen, then you would need something more sophisticated.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!