clean up standard output when running in background
Hi all,
I often run matlab in background, by issuing the following command in linux or mac OS (bash)
nohup matlab -nodesktop -nosplash -nodisplay -nojvm < code.m &> out.txt &
This launches the script code.m in a background instance of matlab and redirects the relevant standard output and standard error into out.txt.
The latter file contains a couple of features I'd like to get rid of
1) the matlab "textual splash screen" (the one appearing in the command window when launching matlab in interactive graphical mode)
2) a variable number of consecutive instances of the prompt ">>".
For instance the following code
fprintf('\n\n\n\n'); a=1; fprintf('hello\n'); b=2; warning('whoa'); c = 3; fprintf('\n\n\n\n'); fprintf('%d\n',c); for j=1:3 fprintf('%d %d\n',j,c*j); end error('hey!!'); exit;
produces the following output
< M A T L A B (R) > Copyright 1984-2010 The MathWorks, Inc. Version 7.12.0.635 (R2011a) 64-bit (maci64) March 18, 2011
To get started, type one of these: helpwin, helpdesk, or demo. For product information, visit www.mathworks.com.
>>
>> >> hello >> >> Warning: whoa >> >>
>> 3 >> 1 3 2 6 3 9 >> ??? hey!!
>> >>
I'd like to get rid of the "splash screen", although I can live with it.
What I find really annoying is the apparently random appearance of the prompts ">>". With more complex codes much longer sequences of ">>" appear.
I know I could print my output in some output file, instead of the stdout. But getting rid of all the above stuff would simplify my life.
Anyone has any idea of why I'm getting these ">>" and how can I get rid of them?
Thanks a lot for any help
Francesco
UPDATE
- I tried placing clc before the first fprintf, but had no effect;
- The same "problem" affects the most recent version of matlab I've got, i.e. matlab R2014b
0 件のコメント
回答 (1 件)
参考
カテゴリ
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!