how to save and plot different matrix?
2 次查看(过去 30 天)
显示 更早的评论
Hi all,
I've written the following code to get the matrix of SST (sea surface temperature), but also I want to get the plot of each sst matrix that should be extracted from each file (92:140) = 49. also I need to save get each matrix alone and save all of 49 in one .mat file but different variable.
I donno where I am mistaken. any help would be appreciated. Thanks
for i=92:140;
% filename=[files(i).name];
% disp(['Processing ', files(i).name]);
% sst = ncread(filename,'sea_surface_temperature');
% lon = ncread(filename,'lon');
% lat = ncread(filename,'lat');
% sst = sst';
idxlon = find(lon>lonmin & lon<lonmax);
goodlon = lon(idxlon);
idxlat = find(lat>latmin & lat<latmax);
goodlat = lat(idxlat);
subset_sst = sst(idxlat,idxlon); %this is the data i want
y=files(i).name(1:4);
dd=files(i).name(7:8);
mm=files(i).name(5:6);
DT=strcat(dd,'/',mm,'/',y);
DAY=[DAY;DT];
figure
imagesc(goodlon,goodlat,subset_sst) %plot this line separtly
axis xy tight
end
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Mapping Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!