Reputation: 2259
I have the following statements to set the diary & diary file:
fnDiary = [ mfilename '.out.txt' ]
system(['rm -f ' fnDiary])
diary off; diary fnDiary
This doesn't work, since Octave thinks I want the diary file name to be "fnDiary". Is there a way to specify the diary file using a string variable?
Upvotes: 0
Views: 282
Reputation: 8091
This is a common error. Octave (and Matlab) treats arguments for a function outside () as string. Use this:
fnDiary = [ mfilename '.out.txt' ]
unlink (fnDiary)
diary off;
diary (fnDiary)
Upvotes: 2