Find a vector components value in matlab

137 views Asked by At

I have thw following problem

Considering the matrix

M = [1 2 3; 4 5 6; 7 8 10]

And the vector

E = [Ex; Ey; Ez]

And

B = [1; 4; 10]

Does anyone knows how to find the values of E components in matlab, considering

M*E=B?
1

There are 1 answers

6
Nick On BEST ANSWER

Use the following command, using mldivide or the equivalent operator \:

E = M\B

This results in:

E =

    4.0000
   -6.0000
    3.0000

Verification:

M*E

ans =

 1.0000
 4.0000
10.0000