Solving a system of linear equations with lots of o coefficients.

3 views (last 30 days)
Emily Pierce
Emily Pierce on 18 May 2022
Answered: Bjorn Gustavsson on 18 May 2022
I have a matrix system of linear equations that look somthing like this were u is a vector of 7 unknowns
I have tried useing linsolve to solve this but My solution is coming out as 0. I am unsue how to fix this.
Thank you for your time and help!
12 8 0 0 0 0 0
-4 12 8 0 0 0 0
0 -4 12 8 0 0 0 (u) =
0 0 -4 12 8 0 0
0 0 0 -4 12 8 0
0 0 0 0 -4 12 8
0 0 0 0 0 -4 12
12
0.7
0.4
1
1.2
1,7
-25

Answers (1)

Bjorn Gustavsson
Bjorn Gustavsson on 18 May 2022
Matlab is designed to solve systems of linear equations. It is one of the fundamental operators of its matrix-algebra:
% Your problem is
% u = M*x;
% that has a solution:
x = M\u;
% Check #1:
M*x - u
% Check #2:
[U,S,V] = svd(M);
disp(diag(S))
Since you ask this question this way I deduce that you are reasonably new working with matlab. If that conclusion is close enough to correct, then you might consider browsing through the onramp material, it is an overview-introduction type presentation/course thing that is designed to get you up to speed ASAP. My understanding is that if you go through the parts you find relevant there and then browse/look through the help and documentation on things you'll get up to speed faster than by any other method.
HTH

Community Treasure Hunt

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

Start Hunting!