Visualize three variables in Matlab

2 ビュー (過去 30 日間)
Malshikho
Malshikho 2014 年 10 月 10 日
コメント済み: Star Strider 2014 年 10 月 10 日
Hi Dear Matlab Experts, I have a matrix consist of three columns. Age, Volume, amount of liquid. I want to create 3 D plot in matlab to visualize the relationship between those variables. The matrix is: Age 10 7 8 9 5 Volume 1000 950 800 1500 600 Quantity 1.3 0.8 2.4 2.6 3.1
Kindly what is the best way to visualize the relationship between those variables? Thanks a lot for any comment or suggestion Looking forward to learn from you Thanks

採用された回答

Star Strider
Star Strider 2014 年 10 月 10 日
The easiest way is to use stem3 because it locates the points it displays:
Age = [10 7 8 9 5];
Volume = [1000 950 800 1500 600];
Quantity = [1.3 0.8 2.4 2.6 3.1];
figure(1)
stem3(Age', Volume', Quantity')
grid on
xlabel('Age')
ylabel('Volume')
zlabel('Quantity')
  2 件のコメント
Malshikho
Malshikho 2014 年 10 月 10 日
編集済み: Malshikho 2014 年 10 月 10 日
I want to plot a new group also has three variables on the same plot. How can I show the volume as a mass so I can visualize the overlap between the volumes? Also if I want to plot 3 variables using scatter3 to make 3D scatter plot how can I show the 3D trendline?
Star Strider
Star Strider 2014 年 10 月 10 日
I do not understand ‘show the volume as a mass’. It is possible to colour the points differently for each data set. (I chose stem3 over scatter3 for small numbers of data because it makes the relationships easier to see.)
I also do not understand how you want to ‘show the 3D trendline’. If you have a specific model in mind, it is relatively easy to fit it to your data. Otherwise, one of the interpolation functions could work.
If you could post a representative sample of your data and a description of what you want to do with it, I can probably provide you with a more specific solution.

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by