フィルターのクリア

How to plot 5D in MATLAB

38 ビュー (過去 30 日間)
ANANTA BIJOY BHADRA
ANANTA BIJOY BHADRA 2023 年 5 月 10 日
編集済み: Cris LaPierre 2023 年 9 月 25 日
I have four variables and one output. The variables are A, B, C, D. All are 11*1 matrix. Based on the four avriables, the Z is calculated. I would like to plot A, B, C, D, Z as a 5D plot. Is it possible in MATLAB? If possible, How can I do that?
  3 件のコメント
DGM
DGM 2023 年 5 月 12 日
編集済み: DGM 2023 年 5 月 12 日
You may find that simpler representations are more readable. Considering that you're asking how to create a complicated and potentially unreadable visualization of some particular data, being familiar with the context is likely necessary in order to judge whether any particular solution is appropriate.
the cyclist
the cyclist 2023 年 5 月 12 日
Are you able to hand-draw what your five-dimensional plot would look like, and upload the image?

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

採用された回答

Cris LaPierre
Cris LaPierre 2023 年 5 月 10 日
Your first 3 dimensions can be visualized on a cartesian axes (X,Y,Z). You'll need to get creative to view higher dimensions. For those dimensions, you can look into varying color, size, or marker shape to convey information about higher dimensions.
So here, I would try scatter3 with the following syntax:
  2 件のコメント
Cris LaPierre
Cris LaPierre 2023 年 5 月 16 日
編集済み: Cris LaPierre 2023 年 9 月 25 日
You never broght your variables back to this question. You have a variable F that is a function of W,X,Y,and Z. The result is an 11x11x11x11 array. That makes it a bit trickier to visualize, but following my suggestion above, here's one aproach. One big caveat - there is no guarantee that W, X, Y and Z align properly with F. You never said how you looped through them to calculate F, so I had to make some assumptions.
W, X and F are visualized along the cartesian coordinate axes. Y is visualized by marker size, and Z is incorporated into marker color.
load ABBvars.mat
[gW,gX,gY,gZ] = ndgrid(W,X,Y,Z);
scatter3(gW(:),gX(:),F(:),rescale(gY(:),2,30),gZ(:),"filled");
c = colorbar;
c.Label.String = 'Z';
xlabel('W')
ylabel('X')
zlabel('F')
view([-60 35])
ANANTA BIJOY BHADRA
ANANTA BIJOY BHADRA 2023 年 5 月 22 日
Yes. Your code gave me the exact answers that I needed. Thank you.

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 5 月 12 日
You cannot. A screen has two independent physical coordinates. You can use animation to add a time coordinate. You can use color to represent another coordinate. That is four coordinates representable, but you have five coordinates.
  1 件のコメント
Walter Roberson
Walter Roberson 2023 年 5 月 12 日
Ah, I had forgotten a possibility. You could code at least part of your project in Simulink, and build a Virtual Reality World, https://www.mathworks.com/help/sl3d/build-virtual-reality-worlds.html . With appropriate VR googles, that would give you an apparent additional dimension. However... the encoding of one of the dimensions in virtual space requires that you have time to move your head position to get different viewpoints, and to some degree that conflicts with using time to encode one of the physical coordinates. You would need to make compromises such as making the time-encoded coordinate relatively slow compared to the rate you would be likely to want to move your head to access the virtual physical coordinates.

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

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by