How to plot a road along its height.

조회 수: 3 (최근 30일)
Muhammad Qaisar Fahim
Muhammad Qaisar Fahim 2022년 3월 21일
댓글: Sam Chak 2022년 3월 21일
Actually the data I have has latitude(x) and longitude(y) of a road and also I have height of the road (z). Now I want to construct a plot which has shows height too and that height should be color coded. How can I do that ?
  댓글 수: 2
Sam Chak
Sam Chak 2022년 3월 21일
Are you trying to plot a top view of the roads and indicate the height of each road?
Muhammad Qaisar Fahim
Muhammad Qaisar Fahim 2022년 3월 21일
Yes that is what I want. I copied a data in below comment which include longitude, latitude and height

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

채택된 답변

KSSV
KSSV 2022년 3월 21일
Read about surf. It also depends on what data you have and how want to show up the plot. More help on sharing the data and showing your expectations.
  댓글 수: 7
Muhammad Qaisar Fahim
Muhammad Qaisar Fahim 2022년 3월 21일
Yes I think its helping out. Thanks
KSSV
KSSV 2022년 3월 21일
Your data is huge, you need to restrict the data to a certain limit, plot and then see.

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

추가 답변 (1개)

Sam Chak
Sam Chak 2022년 3월 21일
I guess you want to show something like this. Because the data is dense, it is not recommended to show the height of every point. But you can definitely adjust how and which particular point/region that you want to show the heights.
plot(A, B)
for t = 1:4379:numel(A)
text(A(t) + 0.0001, B(t) + 0.0001, ['(',num2str(C(t)),')'])
end
  댓글 수: 7
Sam Chak
Sam Chak 2022년 3월 21일
Wait. I think you need to consider the Earth radius (6371 km) in order to project the location of the points on the curved surface in Cartesian coordinates.
And then at each point, you want to show the elevation in the C.mat data using the color gradient. I think the z coordinate in not needed.
x = (6371).*cos(B).*cos(A);
y = (6371).*cos(B).*sin(A);
z = (6371).*sin(B);
Sam Chak
Sam Chak 2022년 3월 21일
Is the road curved? We need you to confirm.
x = (6371).*cos(B).*cos(A);
y = (6371).*cos(B).*sin(A);
scatter(x, y)

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

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by