MATLAB Answers

How to take the inverse of each individual array value and store it to a new array?

조회 수: 3(최근 30일)
immo
immo 19 Feb 2020
편집: KSSV 19 Feb 2020
I am given the following task : Take an input of the 4 resistances given in the problem (R1 , R2 , R3 , R4) as an array - I do that by the following command:
Resistances = input('Enter R1, R2, R3, R4 [ ] around them');
Now, I am asked to calculate the conductance of each resistor from the array the user inputs.
Conductance is simply 1/R, so how can I take each value from my "Resistances" array and take the inverse of it, then put it to a "Conductances" array?

  댓글 수: 0

로그인 to comment.

답변(1개)

KSSV
KSSV 19 Feb 2020
편집: KSSV 19 Feb 2020
If R is value, if you want inverse use
C = 1/R ;
If R is an array use:
C = 1./R ;
In your case..use
Conductances = 1./Resistances ;

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

태그


Translated by