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!