how to find parallel of resistors

153 ビュー (過去 30 日間)
Kartickeyan V
Kartickeyan V 2017 年 7 月 18 日
コメント済み: DO-HYEON CHEON 2021 年 11 月 8 日
Is there any easy function to calculate parallel and series of resistors when i tried its showing error Wrong number of input arguments for obsolete matrix-based syntax.
  1 件のコメント
KSSV
KSSV 2017 年 7 月 18 日
What you tried show us the code...

サインインしてコメントする。

回答 (4 件)

Fabio Freschi
Fabio Freschi 2020 年 11 月 26 日
編集済み: Fabio Freschi 2020 年 11 月 26 日
Maybe it's too late for the OP, but for the records, I usually use an anonymous function with multiple inputs
% ananymous parallel function
p = @(varargin)1/sum(1./[varargin{:}]);
% anonymous series funciton
s = @(varargin)sum([varargin{:}]);
% data
r1 = 100;
r2 = 200;
r3 = 300;
r4 = 400;
% call the functions with an arbitrary number of inputs
p(r1,r2)
s(r1,r2)
p(r1,r2,r3)
s(r1,r2,r3)
p(r1,r2,r3,r4)
s(r1,r2,r3,r4)
  1 件のコメント
DO-HYEON CHEON
DO-HYEON CHEON 2021 年 11 月 8 日
That helped much to me. Thank you!

サインインしてコメントする。


Andrei Bobrov
Andrei Bobrov 2017 年 7 月 18 日
編集済み: Andrei Bobrov 2017 年 7 月 18 日
Z_parallel = 1/sum(1./z); % here z - parallel resistors
Z_series = sum(z); % here z - series resistors
  1 件のコメント
Chaudhary P Patel
Chaudhary P Patel 2021 年 7 月 23 日
is it correct?

サインインしてコメントする。


Jiji George
Jiji George 2020 年 3 月 9 日
function R = resistors( r1, r2, r3, r4, r5 )
r1 = 100;
r2 = 200;
r3 = 300;
r4 = 400;
r5 = 500;
z = [r1 r2 r3]
R = 1/(sum((1/r1)+(1/r2)+(1/r3)))
end

Nav Riar
Nav Riar 2020 年 3 月 15 日
function R = resistors( r1, r2, r3 )
r1 = 100;
r2 = 200;
r3 = 300;
z = [r1 r2 r3]
R = 1/(sum((1/r1)+(1/r2)+(1/r3)))
end

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by