How to extract data from 3D matrix using shape file
조회 수: 9 (최근 30일)
이전 댓글 표시
I am working on an atmospheric trasport model output. The output is in format of Netcdf file for each day of month. Some of attributs of the fiel are as follows:
Projection: Lambart Conformal
Latitude: 307X407X1
Longitude: 307X407X1
Vertical Levels: 39X1
I have extracted required variables with diamentions as follows:
(anthropogenic)Ant: 307X407X39
(Biomass)Bbu: 307X407X39
(Background)Bck: 307X407X39
(Biogenic)Bio: 307X407X39
(Total)TOT: 307X407X39
(Pressure)Press: 307X407X39
I have processed each level for entire region but now want to extract data over my study region. I tried inpolygon and Maskregion (from file exchange) but it shows following error
Out of memory. Type "help memory" for your options.
Error in meshgrid (line 62)
yy = repmat(ycol,size(xrow));
Error in maskregion (line 40)
[xx,yy]=meshgrid(filelon,filelat);
Initially I thought the problem is related to difference in projection system of shp file but even after using same projections I am getting same error. Its problem with meshgrid. Is there any way to solve this?
I tried attching sample.mat file and .shp file of my study region for reference but its too big. Please help me to figure this out.
댓글 수: 0
답변 (1개)
KSSV
2020년 10월 20일
Your lon, lat are already matrices...you need not to use meshgrid. You are creating unnecessary data.
lon = squeeze(filelon) ;
lat = squeeze(filelat) ;
That's it you have your grid coordinates.
참고 항목
카테고리
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!