question on electrical circuit

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 件のコメント

PRASANTH R
PRASANTH R 2020 年 12 月 28 日
output is coming but not passing the given condition please help me to solve the problem.
Walter Roberson
Walter Roberson 2020 年 12 月 31 日
Your A is not singular, so you could use A\y instead of pinv(A)*y
PRASANTH R
PRASANTH R 2020 年 12 月 31 日
thanks brother

回答 (0 件)

この質問は閉じられています。

製品

リリース

R2020b

質問済み:

2020 年 12 月 28 日

閉鎖済み:

2025 年 6 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by