I have problem with matrix form.
Show older comments
R=[1; 2; 3; 4; 5;]
G=1./R
isl=1
us2=10
alpha=2
A =[G(4) ,0 ,-G(4), 0,0,-1,1;
0,G(1)+G(2)+G(3), -G(2), 0, -G(1),0,0;
-G(4), -G(2), G(2)+G(4)+G(5),0,0,0;
0,0,-G(5),G(5),0,0,-1;
0,-G(1),0,0,G(1),1,0;
-1,0,0,0,1,0,0;
0,G(3)*alpha,0,0,0,0,-1]
b=[0;0;is1;0;0;us2;0]
x=A\b;
Ur=[x(5)-x(2); x(2)-x(3); x(2);x(1)-x(3);x(4)-x(3)]
Ir=Ur./R
i got Error using vertcat
Dimensions of matrices being concatenated are not consistent.
where is problem?
Answers (1)
Star Strider
on 27 Oct 2019
The third row of ‘A’ only has 6 elements:
-G(4), -G(2), G(2)+G(4)+G(5),0,0,0;
The other rows have 7.
Categories
Find more on Resizing and Reshaping Matrices 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!