relocate a part of an image

조회 수: 1 (최근 30일)
Ha Sen
Ha Sen 2018년 7월 5일
답변: KSSV 2018년 7월 5일
Hi,
I am having a matrix of time series of temperature images (lon,lat,time). The given images/matrix (see first attachment) starts from Africa/Europe and moves on to North/South America. My other data sets starts from North/South America and moves on to Africa/Europe See (second/third attachment). For further analysis I need to have same matrix or structure. How can I change the first image so that it looks like the second one. Maybe cropping the end and setting it in the front? Unfortunately, I am not able to do it.
Any help is appreciated! Thanks
  댓글 수: 6
KSSV
KSSV 2018년 7월 5일
This the plot I got from tmax2016.nc file.
Ha Sen
Ha Sen 2018년 7월 5일
Ok, so you can see that your image shows (from left to right) first africa than asia and lastly north/south america. I want to start it with N/S America than Africa than Asia like my last image (3rd or 4th)

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2018년 7월 5일
ncfile = 'C:\Users\srinivas\Downloads\tmax.2016.nc' ;
lon = ncread(ncfile,'lon') ;
lat = ncread(ncfile,'lat') ;
tmax = ncread(ncfile,'tmax') ;
lon = lon-180 ;
idx = lon>=0 ;
lon(idx) = lon(idx)-360 ;
[lon,idx] = sort(lon) ;
pcolor(lon,lat,tmax(idx,:,1)') ; shading interp ;

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by