把nc数据批量保存为mat格式。
Afficher commentaires plus anciens
想把文件夹里的所有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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB 快速入门 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!