the plot and the patch is totally different from same data, how to solve it?

조회 수: 4 (최근 30일)
Sierra
Sierra 2022년 6월 26일
댓글: dpb 2022년 6월 26일
for i = 1:length(trajectory)
plot3(trajectory(i).Longitude, trajectory(i).Latitude, trajectory(i).Altitude)
hold on
end
for i = 1: length(trajectory)
xptcl = prctile(trajectory(i).Longitude,[2.5 97.5]);
yptcl = prctile(trajectory(i).Latitude,[2.5 97.5]);
zptcl = prctile(trajectory(i).Altitude,[2.5 97.5]);
xptcl = [xptcl;];
yptcl = [yptcl;];
zptcl = [zptcl;];
xl(i,:) = xptcl;
yl(i,:) = yptcl;
zl(i,:) = zptcl;
patch([xptcl flip(xptcl)], [yptcl flip(yptcl)], [[1 1]*zptcl(1) [1 1]*zptcl(2)],'r', 'FaceAlpha',0.5)
hold on
end
plot3(xl(:,1), yl(:,1), zl(:,1), '-k', 'LineWidth',2)
plot3(xl(:,1), yl(:,1), zl(:,2), '-k', 'LineWidth',2)
plot3(xl(:,2), yl(:,2), zl(:,1), '-k', 'LineWidth',2)
plot3(xl(:,2), yl(:,2), zl(:,2), '-k', 'LineWidth',2)
grid on
view(45,30)
I wroted the code likt this above.
but it seems totally wrong.
the patch should be narrower than trajectory, because i set the range with percentile 2.5 and 97.5.
how can the patch be more bigger than the trajectory?
I thought at least the patch's size is as same as trajectory's size.
  댓글 수: 3
Walter Roberson
Walter Roberson 2022년 6월 26일
We do not know that there is a connection between the values in the trajectory structure, compared to the x* y* z* variables
dpb
dpb 2022년 6월 26일
The plot appears they are related given shapes shown, but could be scaled differently, for example.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Polygons에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by