I'm getting the inv error code saying it must be squared
Show older comments
I can't find where my error is, can some one help please
My code is :
E1=3;
E2=2;
Z1= j*10e-03;
Z2= 1.5e03;
Z3= -j* 0.1e-06;
Z4= j*1e-03;
Z5= -j*1e-06;
Z6= 10e03;
Z= [(Z1+Z2+Z3) (-Z3); (-Z3) (Z3+Z4+Z5); (Z5+Z6) (-Z5)]
Z =
1.0e+04 *
0.1500 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i
1.0000 - 0.0000i 0.0000 + 0.0000i
E= [E1;0;-E2]
E =
3
0
-2
I = inv(Z)*E
Error using inv
Matrix must be square.
Accepted Answer
More Answers (1)
inv takes the inverse of a square matrix (that is, a matrix with size n-by-n for some n). In this case you are trying to take the inverse of the matrix Z, but Z is not square (it's 3-by-2), so you get that error. Check that your definition of Z is correct.
Categories
Find more on Error Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!