Info

This question is closed. Reopen it to edit or answer.

question on electrical circuit

3 views (last 30 days)
PRASANTH R
PRASANTH R on 28 Dec 2020
Closed: Sabin on 20 Jun 2025
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 Comments
Walter Roberson
Walter Roberson on 31 Dec 2020
Your A is not singular, so you could use A\y instead of pinv(A)*y

Answers (0)

This question is closed.

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!