我想在bash中非交互地调用matlab,并在Matlab之外使用它的结果。抑制Matlab的启动消息
例如,我有一个脚本test.m
rand(3,4)
quit
当我在bash
$ matlab -nosplash -nodesktop -nodisplay -r test
Warning: No window system found. Java option 'MWT' ignored
< M A T L A B (R) >
Copyright 1984-2008 The MathWorks, Inc.
Version 7.7.0.471 (R2008b)
September 17, 2008
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
ans =
0.8147 0.9134 0.2785 0.9649
0.9058 0.6324 0.5469 0.1576
0.1270 0.0975 0.9575 0.9706
执行是否有可能抑制Matlab的开始消息,也仅显示结果,而不“ANS =”。
注意我不只是为这个例子提出一个普遍问题。
感谢和问候!
在八度你可以使用'-q'标志。 – sffc 2015-09-15 20:45:21