How to make a logical mask using a shape file?

조회 수: 11 (최근 30일)
Devendra
Devendra 2024년 3월 26일
댓글: Image Analyst 2024년 3월 28일
I am using following MATLAB code to create logical mask.
% Create a logical mask
[Z,R] = readgeoraster(img_file.name);
disp(R);
[lat,lon] = geographicGrid(R);
[Lon, Lat] = meshgrid(lon, lat);
logical_mask = reshape(isinterior(polygon, Lon(:), Lat(:)), size(Lon));
It is giving following erros
Incorrect number or types of inputs or outputs for function geographicGrid.
Error in ds_indices_caf (line 57)
[lat,lon] = geographicGrid(R);
I request to kindly suggest me how to do it correctly.
Dava

답변 (1개)

Image Analyst
Image Analyst 2024년 3월 26일
You have to define lat and lon as vectors before you use them in meshgrid to get the full matrices Lat and Lon as outputs.
  댓글 수: 8
Devendra
Devendra 2024년 3월 27일
I have installed trial version of Matlab 2024a.
Deva
Image Analyst
Image Analyst 2024년 3월 28일
I believe during the trial period you get free telephone help. Call them and work through it with an actual live person. I can't help you because I do not have that toolbox.

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

카테고리

Help CenterFile Exchange에서 Image Sequences and Batch Processing에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by