x=5;
y=0;
z=0;
S=[(1.28*10^10)x*y-(2.56*10^10)y (2.56*10^6)-(6.4*10^9)*(y^2) -(6.4*10^9)y*z; (2.56*10^6)-(6.4*10^9)*(y^2) -(1.28*10^10)x*y+(2.56*10^10)y 0; 0 -(6.4*10^9)y*z -(1.28*10^10)x*y+(2.56*10^10)y];
[Q, Lambda]=eig(S);
disp(Lambda);
I want to plug in values of x y and z for the Matrix S, but for some reason it shows that I have error. How do I fix matrix S so it works in MATLAB?

 採用された回答

VBBV
VBBV 2020 年 11 月 9 日

0 投票

%if true
% code
%end
x=5;
y=0;
z=0;
S=[(1.28*10^10)*x*y-(2.56*10^10)*y (2.56*10^6)-(6.4*10^9)*(y^2) -(6.4*10^9)*y*z; (2.56*10^6)-(6.4*10^9)*(y^2) -(1.28*10^10)*x*y+(2.56*10^10)*y 0; 0 -(6.4*10^9)*y*z -(1.28*10^10)*x*y+(2.56*10^10)*y];
[Q, Lambda]=eig(S);
disp(Lambda);

その他の回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 11 月 9 日
編集済み: Ameer Hamza 2020 年 11 月 9 日

0 投票

MATLAB does not have implicit multiplication. You need to write the multiplication operator explicitly. For example, the first term in your matrix is
(1.28*10^10)x*y-(2.56*10^10)y
change it to
(1.28*10^10)*x*y-(2.56*10^10)*y
Similarly, change all the terms.

カテゴリ

タグ

質問済み:

2020 年 11 月 9 日

回答済み:

2020 年 11 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by