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]
3 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]3 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
What is blockchain? How it works? I heard bitcoin uses it.
igor_vitrenko [27]
Https://www.toptal.com/bitcoin/blockchain-technology-powering-bitcoin
i dont have the time to read it right now, but i was able to find you this link that should hopefully help- you out!
6 0
3 years ago
A DFA is equivalent in power to an NFA. True False
sattari [20]

Answer: True

Explanation:

  Yes, the given statement is true that a DFA is equivalent to NFA in terms of power. For any type of NFA we can easily build an equal DFA so, the NFA are not much powerful as compared to DFA. Both NFA and DFA are characterized by a similar type of class.

DFA is a special case of NFA and They both defined in the same class of language. Each condition in the DFA get summarized by all the condition that the NFA has itself.

4 0
3 years ago
Question 9/10
Firlakuza [10]
They sometimes offer free service
5 0
3 years ago
Read 2 more answers
Ask the user to input an integer. Print out the next three consecutive numbers.
Fed [463]

I've included my code in the picture below. Best of luck.

5 0
3 years ago
8.7 Code Practice Question 3
lorasvet [3.4K]

I included my code in the picture below.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Hudson has to maintain confidential college data in a workbook. He needs two team members to help him update data in the specifi
    7·2 answers
  • It is essential that a security professional is able to resolve and respond to cyber law inquiries and incidents while avoiding
    14·1 answer
  • Identify possible advantages and disadvantages of using automatic withdrawal to pay bills
    12·2 answers
  • In cell R9, enter a formula using the AVERAGEIF function to determine the average number of years of experience for lifeguards.
    12·1 answer
  • What is the purpose of a turbine in a power plant?
    14·1 answer
  • What problem with internal hardware components is similar to unplugged
    6·2 answers
  • Which of the following people was a member of FFA?
    7·1 answer
  • 8.7 Code Practice: Question 2 edhesive
    14·2 answers
  • Write a SELECT statement that returns one row for each musician that has orders with these columns:
    13·1 answer
  • What year does futurist ray kurzweil believe ai will meet human intelligence?.
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!