Matlab from Command promt

1 Ansicht (letzte 30 Tage)
john birt
john birt am 24 Mär. 2012
Beantwortet: Bibhav Poudel am 11 Dez. 2019
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

Akzeptierte Antwort

Oleg Komarov
Oleg Komarov am 24 Mär. 2012
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.

Weitere Antworten (1)

Bibhav Poudel
Bibhav Poudel am 11 Dez. 2019
license

Kategorien

Mehr zu Startup and Shutdown 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!

Translated by