I want to write a function that calculate the voltage for three junctions A,B and C in the picture below if we know the voltage of V. (G=0V). Did anyone write it before?
5 次查看(过去 30 天)
显示 更早的评论

1 个评论
采纳的回答
Milad Mehrnia
2021-11-30
function ans = voltage(V,R)
E1 = [R(2)*R(7)+R(1)*R(2)+R(1)*R(7) -R(1)*R(2) 0]
E2 = [-R(3)*R(8)*R(4) R(4)*R(8)*R(7)+R(3)*R(8)*R(4)+R(3)*R(7)*R(4)+R(3)*R(7)*R(8) -R(3)*R(7)*R(4)];
E3 = [0 -R(5)*R(6) R(8)*R(6)+R(5)*R(6)+R(5)*R(8)];
E = [E1;E2;E3];
b = V.*[R(2)*R(7);R(4)*R(8)*R(7);R(8)*R(6)];
ans = E\b;
end
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!