简体   繁体   中英

Find a vector components value in matlab

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM