Slice command for terrain

7 views (last 30 days)
burak ergocmen
burak ergocmen on 19 Feb 2024
Commented: burak ergocmen on 22 Feb 2024
Hi,
After dowloading topo data (.tif) from opentopography.org. I use "Imread". For plotting the data
A=imread('appRasterNEDAPIService1708354512850-756880040.tif');
surf(A):
It plots the 3D terrain data.
The size of the A is 194x424. It contains elevation data. I want to use slice command but in slice command there are x,y,z, and v.
After meshgrid the dimesion of the x becomes 3D and the same for y and z for 'slice' command. v is the function.
But as I stated my terrain data can not be converted for slice command. Is there anything that helps me?
Thank you

Accepted Answer

Walter Roberson
Walter Roberson on 19 Feb 2024
No. Your data cannot be sliced.
Perhaps you might want to contour() the data, and get back the contour matrix, and use something like https://www.mathworks.com/matlabcentral/fileexchange/38863-extract-contour-data-from-contour-matrix-c to extract data from the contour matrix.
  4 Comments
burak ergocmen
burak ergocmen on 21 Feb 2024
Thank you again
'improfile' can be good start for me but I need 2D plane. With 'improfile', only the line is taken into account. I want to give more information for my problem:
A=imread('appRasterNEDAPIService1708354512850-756880040.tif');
X=1:324;
Y=1:194;
[X,Y]=meshgrid(X,Y);
surf(X,Y,A)
hold on
contour3(X,Y,A,"k",'ShowText','on')
x2=[50 200 200 50 50]; %for the plane
y2=[50 50 170 170 50];
z2=[4200 3800 3800 4200 4200];
plot3(x2,y2,z2);
hold on
fill3(x2,y2,z2,'r')
textscatter3(50,50,4200,"aircraft",'ColorData',[0.5 0.6 0.7]);
textscatter3(200, 170, 3800,"runway", 'ColorData',[0.5 0.6 0.7]);
I draw a 2D plane (red). The aircraft and the runway positions are given. I it possible to create a new map from the intersection of the red plane and the terrain?? Finally I try to create a 2D map. The terrain data in this map is given as for terrain =1 and freeterrain=0. It becomes A= [0 0 0 0 0 0 0 0 ......; 0 0 0 0 0 1 1 1 0 0 0...]]. Maybe it is like that:
Thank you,
burak ergocmen
burak ergocmen on 22 Feb 2024
I use this code to plot the intersection.
I appreciate your suggestion. Thank you

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!