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 日

1 投票

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 件)

カテゴリ

ヘルプ センター および File ExchangeEntering Commands についてさらに検索

質問済み:

2017 年 10 月 10 日

回答済み:

Jan
2017 年 10 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by