Diary problem in Linux Console

1 回表示 (過去 30 日間)
Javier Naranjo
Javier Naranjo 2017 年 10 月 10 日
回答済み: Jan 2017 年 10 月 10 日
Hello everybody,
I am using diary to collect all my fpritnf of my code. When I run hello.m in Matlab I get the correct outputs but when I execute Matlab from Linux console ./matlab < hello.m the diary output is actually my code!!!!
Why do I have different behaviours of the same function?
Thanks in advance,
Javi

採用された回答

Jan
Jan 2017 年 10 月 10 日
Because "< hello.m" pipes the contents of the file to the Matlab console. because it appears there, you find it in the diary also like if you have typed the code manually in the command window.
Use the -r switch instead to execute code:
matlab -r hello.m

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by