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 Center および File Exchange2-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