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

1 次查看(过去 30 天)
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