MATLAB: Problem savind with diary function

diaryMATLABsave

something wierd, only the second time that i run the script the function actually save the data in the txt file. what am i doing wrong? the m file is attached to this post
or maybe there is another solution for this, i'm trying to generate text file with the data taken from the workspace something similar to what there is in the script

Best Answer

If you add
diary on
after line 27, then it should work.
Related Question