How to draw 3d graph for this given situation?.

1 回表示 (過去 30 日間)
mirewuti muhetaer
mirewuti muhetaer 2020 年 2 月 3 日
コメント済み: mirewuti muhetaer 2020 年 2 月 4 日
Hi,
I have a matrix size data and i need to draw the plot.
%%%%%%%%%%%%%%%%%%%%%%
y1 y2 y3 y4
x1 a11 a12 a13 a14
x2 a21 a22 a23 a24
x3 a31 a32 a33 a34
%%%%%%%%%%%%%%%%%%%
when i try :
plot(x, y, z);
it gives me following error message:
Error using plot3
Vectors must be the same length.
So, how can i draw the graph for the above discrete case with different size of length?.
Thanks.

採用された回答

KSSV
KSSV 2020 年 2 月 4 日
You can use pcolor and surf. Read about them.
x = 1:3 ;
y = 1:4 ;
A = rand(4,3) ;
figure
pcolor(x,y,A)
figure
surf(x,y,A)
  1 件のコメント
mirewuti muhetaer
mirewuti muhetaer 2020 年 2 月 4 日
You save my tons of time. Really appreicated

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

その他の回答 (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