the plot and the patch is totally different from same data, how to solve it?
1 回表示 (過去 30 日間)
古いコメントを表示
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1046525/image.png)
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!