https://blog.csdn.net/lihe4151021/article/details/106974950/
1.單個.mat文件保存
save(filename) %將當前工作區中的所有變量保存在 MATLAB格式的二進制文件(MAT 文件)filename 中。
save(filename,variables) %僅保存 variables 指定的結構體數組的變量或字段。
例如:
A=[1 2 3 4 5 6 8 8 8 8 9 ];
save(‘file1.mat’,‘A’); %將變量A保存到當前文件夾中的文件
save(‘E:\實驗數據\梯田法\周期幀累加\file1.mat’,‘A’); %將變量A保存到指定文件夾中的文件
要注意的是:存的文件名+變量名都要用單引號引起來
2.for循環保存.mat文件
for i=1:N
%%%%%%%%%添加其他內容
save(strcat('E:\實驗數據\梯田法\周期幀累加\',num2str(i)),'variables');
end