How can i graph the following matricie in Matlab?

1 回表示 (過去 30 日間)
GURPREET
GURPREET 2012 年 7 月 27 日
I have a 3x3 matrix. Variable are x, y ,z. I wanted to graph this. I'm trying my best but no luck so far. New to matlab. Thank you
alpha = pi/6;
beta = pi/4;
gamma = pi/3;
A = x;
B = y*cos(alpha) + z*sin(alpha);
C = -y*sin(alpha) + z*cos(alpha);
mesh(A, B, C)
grid on
hold on
  2 件のコメント
Oleg Komarov
Oleg Komarov 2012 年 7 月 27 日
What is x, y and z? Rows/columns of your matrix?
Miro
Miro 2012 年 7 月 27 日
i think x y and z should be the cartesian corrdinates.

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

回答 (1 件)

Miro
Miro 2012 年 7 月 27 日
編集済み: Miro 2012 年 7 月 27 日
Code:
%At firtst you have to define your coordinate system like
x=0:0.1:10;
y=0:0.1:10;
% then create the Mesh like
[X,Y] = meshgrid(x,y);
% then calculate your Z value like for example
Z = Y.*cos(alpha) + X.*sin(alpha);
% This was an example. Try around with it or clarify your question
% To see the result simply do
figure;
surf(X,Y,Z)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by