how to save and plot different matrix?

2 views (last 30 days)
Lilya
Lilya on 4 Nov 2018
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

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!