the plot and the patch is totally different from same data, how to solve it?
4 次查看(过去 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
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
2022-6-26
The plot appears they are related given shapes shown, but could be scaled differently, for example.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polygons 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!