MATLAB Answers

Diary problem in Linux Console

2 views (last 30 days)
Javier Naranjo
Javier Naranjo on 10 Oct 2017
Answered: Jan on 10 Oct 2017
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

  0 Comments

Sign in to comment.

Accepted Answer

Jan
Jan on 10 Oct 2017
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 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.