how do i solve matrix error dimensions here

1 Ansicht (letzte 30 Tage)
pejhan stiff
pejhan stiff am 2 Jan. 2021
Beantwortet: Image Analyst am 2 Jan. 2021
Hello
Can anyone help me with this code
I don't know what's wrong about it, or how can i solve it.
I want to find P in this question
and this is my code
k=-0.8146;T=0.1268;
M = [k, T, 0, 0 ;
T, k, T, 0 ;
0, T, k, T ;
0, 0, T, -0.6878];
J=[-4126.78;-3365.98;-3215.98;-3365.98];
J/M

Akzeptierte Antwort

Image Analyst
Image Analyst am 2 Jan. 2021
Try this:
k=-0.8146;
T=0.1268;
M = [k, T, 0, 0 ;
T, k, T, 0 ;
0, T, k, T ;
0, 0, T, -0.6878]
J = [-4126.78;-3365.98;-3215.98;-3365.98]
p = inv(M) * J
% Double check
pVerify = M * p % Should equal J or be very very close.

Weitere Antworten (0)

Kategorien

Mehr zu Operating on Diagonal Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by