0
我想用'save'命令在while循环的不同时间步中保存一些变量。它在我以前写过的其他程序中工作。这是它第一次没有保存。我尝试了很多事情,比如重命名保存数据的文件,重命名脚本,但不起作用。这里的示例代码:MATLAB:保存命令不能正常工作
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)
我无法想出一个办法出于此。