How to make a logical mask using a shape file?

7 Ansichten (letzte 30 Tage)
Devendra
Devendra am 26 Mär. 2024
Kommentiert: Image Analyst am 28 Mär. 2024
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

Antworten (1)

Image Analyst
Image Analyst am 26 Mär. 2024
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 Kommentare
Devendra
Devendra am 27 Mär. 2024
I have installed trial version of Matlab 2024a.
Deva
Image Analyst
Image Analyst am 28 Mär. 2024
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Produkte


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by