Slice command for terrain

조회 수: 7 (최근 30일)
burak ergocmen
burak ergocmen 2024년 2월 19일
댓글: burak ergocmen 2024년 2월 22일
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

채택된 답변

Walter Roberson
Walter Roberson 2024년 2월 19일
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
burak ergocmen
burak ergocmen 2024년 2월 21일
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 2024년 2월 22일
I use this code to plot the intersection.
I appreciate your suggestion. Thank you

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by