1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
icang [17]
2 years ago
15

Matlab In this assignment you will write a function that will calculate parallel resistance for up to 10 parallel resistors. Cal

l the function by ParallelR(Number), where Number is an integer between 1 and 10 which will be input from a command window prompt. Use a for loop Number times to find the Numerator and Denominator for parallel resistance. After the for loop you should find Solution as Num/Den. the number Solution will be returned by the function.

Computers and Technology
1 answer:
Ket [755]2 years ago
8 0

Answer:

The complete Matlab code along with step by step explanation is provided below.

Matlab Code:

function Req=ParallelR(Number)

Number=input('Please enter the number of resistors: ');

if Number>10 | Number<=0

   disp('Invalid input')

return

end

R=0;

for i=1:Number

r=input('Please enter the value of resistor: ');

R=R+1/r;

end

Req=1/R;

end

Explanation:

Parallel resistance is given by

\frac{1}{Req} = \frac{1}{R_{1}} + \frac{1}{R_{2}} + \frac{1}{R_{3}}...+\frac{1}{R_{N}}

First we get the input from the user for how many parallel resistors he want to calculate the resistance.

Then we check whether the user has entered correct number of resistors or not that is from 1 to 10 inclusive.

Then we run a for loop to get the resistance values of individual resistors.

Then we calculated the parallel resistance and keep on adding the resistance for N number of resistors.

Output:

Test 1:

Please enter the number of resistors: 3

Please enter the value of resistor: 10

Please enter the value of resistor: 20

Please enter the value of resistor: 30

ans =       60/11

Test 2:

Please enter the number of resistors: 11

Invalid input

Test 3:

Please enter the number of resistors: 0

Invalid input

You might be interested in
____ software is used to block unwanted e-mail and is available at many levels.
Anika [276]
Anti-spam <span>software is used to block unwanted e-mail and is available at many levels.</span>
3 0
3 years ago
When inserting a fly in animation what is the first step in the process?
marishachu [46]

Answer:

The answer: select the element you wish to animate.

Explanation:

4 0
3 years ago
Is the movie IT really that scary ? Rate between 1-10, 10 being I had nightmares
mezya [45]
5 I don’t think it’s good. I thought it was boring.
4 0
3 years ago
When was the phone Built
quester [9]
The first phone was made in 1854 by <span>Antonio Meucci.

Other inventors like </span>Johann Philipp Reis, <span>Alexander Graham Bell, Elisha Gray, and Thomas Edison reinvented the telephone or enhanced it.</span>
3 0
3 years ago
Read 2 more answers
Which of the following is an Internet job search “do”?
grandymaker [24]
I believe that the option among these that is an Internet job search "do" is to pay attention to all directions before responding to job postings. You should be aware that you are never safe on the Internet, so be very careful. 
3 0
3 years ago
Read 2 more answers
Other questions:
  • Whenever I go onto Google Chrome, the words are in Spanish! How can I make the words be back in English again? Please let me kno
    7·1 answer
  • What is an IP address and where I can find the IP address for my computer?
    14·1 answer
  • Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print "Too small". If greater than
    14·2 answers
  • What output is displayed when the code that follows is executed? HashMap sales = new HashMap&lt;&gt;(); sales.put("January", 389
    12·1 answer
  • A blue NFiPA label indicates: A) Health Hazard B) Special information C) Flammability D) Reactivity
    6·2 answers
  • Users of Adobe Reader, created by Adobe Systems Incorporated, are prompted to provide feedback on their experiences with the sof
    7·1 answer
  • A program that will read each player’s name and golf score as keyboard input,
    9·1 answer
  • TASK 1. JUMBLE ME! Direction: Arrange the jumbled letters to form a word. 1. PEREAM 2. RRENT CU 3. METREMO H 4. TORSISER 5. TANC
    10·1 answer
  • How to print<br> 1<br> 321<br> 54321<br> 7654321<br> triangle pattern in python
    13·1 answer
  • Please solve this in JAVA<br><br> Please see the attachment
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!