Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
question on electrical circuit
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
function out = voltage(V,R)
%A*out = y
%out[A;B;C] 3X1 Mmatrix
A = zeros(3,3);
y = zeros(3,1);
% FROM THE FIRST EQ
A(1,1) = R(2)*R(7)+R(1)*R(2)+R(1)*R(7);
A(1,2) = R(1)*R(2);
A(1,3) = 0;
y(1,1) = V*R(2)*R(7);
% FROM THE SECOND EQ
A(2,1) = -R(3)*R(8)*R(4);
A(2,2) = R(7)*R(8)*R(4)+R(3)*R(8)*R(4)+R(3)*R(7)*R(4)+R(3)*R(7)*R(8);
A(2,3) = -R(3)*R(7)*R(4);
y(2,1) = V*R(7)*R(8)*R(4);
% FROM THE THIRD EQ
A(3,1) = 0;
A(3,2) = -R(5)*R(6);
A(3,3) = R(8)*R(6)+R(5)*R(6)+R(5)*R(8);
y(3,1) = V*R(8)*R(6);
% NOW WE DIVIDE TO FIND THE SOLUTION
out = pinv(A)*y;
end

3 comentarios
Walter Roberson
el 31 de Dic. de 2020
Your A is not singular, so you could use A\y instead of pinv(A)*y
Respuestas (0)
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
