フィルターのクリア

Rearrange data plot3 and combine data points

1 回表示 (過去 30 日間)
Tessa Kol
Tessa Kol 2021 年 3 月 9 日
回答済み: Cris LaPierre 2021 年 3 月 9 日
Dear all,
The following piece of code creates a 3D plot. Normally I import the mass data from a .csv file, but for convenience I manually placed the values into a matrix.
Tz = [0 50 100 150 200 50 50 50 50 50];
Duration = [0 5.5 5.5 5.5 5.5 1 2 3 4 5];
Mass = [30.5 33.1 35.4 37.8 39.4 31.2 32.1 32.5 32.9 33.0];
figure
grid on
hold on
plot3(Tz,Duration,cell2mat(Payload),'o')
xlabel('Torque [kNm]')
ylabel('Duration [s]')
zlabel('Mass [ton]')
I have actually 2 problems when plotting the graph:
1) When I apply view(0,180) the values on the z-axis are in decreasing order. How can I reverse the order of the z-axis or rearrange the imported mass data in an efficient way? I tried to use the following solution https://nl.mathworks.com/matlabcentral/answers/260781-plotting-values-in-in-reverse-order#answer_203607, but with no satisfactory result.
2) How can I connect the data points as shown below? Those data points are part of one set, whereas the remaing data points stay as individual data points.
  1 件のコメント
darova
darova 2021 年 3 月 9 日
Connect points this way
plot3(Tz,Duration,cell2mat(Payload),'-o')

サインインしてコメントする。

採用された回答

Cris LaPierre
Cris LaPierre 2021 年 3 月 9 日
For #1, this is because you are rotating your view 180 degrees around the Y axis.
Try view(0,0) instead.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by