Matlab from Command promt

5 次查看(过去 30 天)
So I have a matlab function
function F = myfun5(x)
F = x+5;
exit;
and when I run this from the Windows Command Line
matlab nosplash -r myfun5(3) -logfile c:\temp\logfile
It all works, but the log file is empty, it does not include the answer

采纳的回答

Oleg Komarov
Oleg Komarov 2012-3-24
matlab -nosplash -nodesktop -minimize -r "a = myfun5(3), exit" -logfile C:\logfile.txt
where
function F = myfun5(x)
F = x+5;
end
otherwise it exits before returning the value to the cmd window.

更多回答(1 个)

Bibhav Poudel
Bibhav Poudel 2019-12-11
license

类别

Help CenterFile Exchange 中查找有关 Performance and Memory 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by