how to save and plot different matrix?

조회 수: 2 (최근 30일)
Lilya
Lilya 2018년 11월 4일
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개)

카테고리

Help CenterFile Exchange에서 Mapping Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by