cropping nc4 file with shapefile in matlab
조회 수: 3 (최근 30일)
이전 댓글 표시
I want to crop my nc4 file according to my shapefile extent. I am trying this
file = 'GLDAS_NOAH10_3H.A20050102.0000.020.nc4' ;
lon = ncread(file,'lon') ;
lat = ncread(file,'lat') ;
RF = ncread(file,'SnowDepth_inst') ;
path = [pwd filesep 'indus_upper.shp'] ;
S = shaperead(path) ;
n = length(S) ;
[a,b]=meshgrid(S.Y,S.X);
myX=[a(:)];
myY=[b(:)];
%[Z, R] = vec2mtx(S.Y, S.X, 0.25, 'filled');
%for i = 1:length(myY)
% x = S(i).X ; y = S(i).Y ;
% plot(x,y,'k')
rfi = interp2(lon,lat,RF',myX,myY) ;
I am not sure about my making of meshgrid. Anybody tell me how can i resolve my problem?
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!