I am trying to save some variables at different time steps in a while loop using the 'save' command. It was working in other programs which I had written previously. This is the first time it's not saving. I tried many things like renaming the file to which the data is saved, renaming the script, but it's not working. Here's the sample code:
T=0;
while T<300 (time loop)
loop1
loop2
.
.
.
if T==0.01
save('arbit100x100ht10e-3results.txt','Pnew','unew','-ascii','-append')
else if T==0.02
save('arbit100x100ht10e-3results.txt','Pnew','unew','-ascii','-append')
else if T==0.04
save('arbit100x100ht10e-3results.txt','Pnew','unew','-ascii','-append')
.
.
. (all the if-if else statements have their respective "end")
T=T+ht; %ht is time step
end (while loop)
I am not able to figure out a way out of this.