把nc数据批量保存为mat格式。
Mostrar comentarios más antiguos
想把文件夹里的所有nc数据都转存为mat格式,下面有一个循环,但是保存之后只有一个mat文件,请大神帮忙看一下,非常感谢
pathname='F:\葵花小时\201507\07\';
files=dir([pathname,'*.nc']);
for i=1:length(files)
filename=[pathname,files(i).name];
SST=ncread(filename,'sea_surface_temperature');
% SST=SST(6961:7441,1152:1584);
% sst(:,:,i)=SST;
save('.mat','SST')
end
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre MATLAB 快速入门 en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!