Plotting a specific interval for a given matrix

1 回表示 (過去 30 日間)
Sergio
Sergio 2024 年 1 月 18 日
コメント済み: Sergio 2024 年 1 月 18 日
Hi, I have a matrix with several entries on three rows, and I would like to plot the entries of the 2nd and 3d row values towards the 1st row. This is rather easy, and I do:
plot3(P(:,2),P(:,3),P(:,1));
wheree P is the matrix file. However, I would like to restrict the plot on the 1st row (P(:,1) on the interval [-1,1], the 2nd row on [-10,10] and the 3d on [-3Exp^(-16), 3Exp^(-16)]. I tried:
xlim auto; ylim auto; zlim auto
plot3(P(:,2),P(:,3), P(:,1))
or
xlim([-10 10]); ylim([-2.449293598294706e-16 2.449293598294706e-16]); zlim([-1 1])
plot3(P(:,2),P(:,3), P(:,1))
But the plot is not respecting the periods of the three axes.
How can I do that?
Thanks

採用された回答

Fangjun Jiang
Fangjun Jiang 2024 年 1 月 18 日
移動済み: Fangjun Jiang 2024 年 1 月 18 日
Do you mean to apply xlim(), ylim() and zlim() on the plot?
  9 件のコメント
Fangjun Jiang
Fangjun Jiang 2024 年 1 月 18 日
Your P is 3x100, maybe you mean to do plot3(P(2,:),P(3,:), P(1,:))
Sergio
Sergio 2024 年 1 月 18 日
A!!! Thanks Fangjun!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by