Question

The resistance R in ohms of a conductor is given by R = E/I when E...

The resistance R in ohms of a conductor is given by R = E/I when E is the potential in volts and I is the current in amperes . Write a script that will:

0. call a function to prompt the user for the potential and the current

0. call a function that will print resistance ; this will call a subfunction to calculate and return the resistance .

write the function as well

using MATLAB

Homework Answers

Answer #1

function prompt

E = input("Enter Potential in Volts: ");

I = input("Enter Current in Ampere: ");

R = cal(E,I);

function R = cal(E,I)

R = E/I;

end

fprintf("Resistacne is %f ohms",R)

end

Please refer to the screenshot of the code to understand the indentation of the code

Sample Run:

Hope this helped. Please do upvote and if there are any queries please ask in comments section.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a program display the following menu: Ohms Law Calculator 1. Calculate Resistance in Ohms 2....
Write a program display the following menu: Ohms Law Calculator 1. Calculate Resistance in Ohms 2. Calculate Current in Amps 3. Calculate Voltage in volts 4. Quit Enter your choice (1-4) If the user enters 1, the program should ask for voltage in Volts and the current in Amps. Use the following formula: R= E/i Where: E= voltage in volts I= current in amps R= resistance in ohms If the user enters 2 the program should ask for the voltage...
When a current I(measured in amperes) flows through a resistance R(measured in ohms), the power generated...
When a current I(measured in amperes) flows through a resistance R(measured in ohms), the power generated is given by W = I^2R (measured in watts). Suppose that I and R are independent random variables with densities: f(i) = 6i(1-i) for 0 < i < 1 f(r) = 2r for 0 < r < 1 Determine the pdf of W
using ohm's law, calculate the voltage across a conductor with a resistance of 10 ohms, passing...
using ohm's law, calculate the voltage across a conductor with a resistance of 10 ohms, passing a current of 1.2A
A voltage V across a resistance R generates a current I=V/R. If a constant voltage of...
A voltage V across a resistance R generates a current I=V/R. If a constant voltage of 11 volts is put across a resistance that is increasing at a rate of 0.6 ohms per second when the resistance is 8 ohms, at what rate is the current changing?
[Series circuit analogue: RLC circuit with nonzero resistance R and nonzero voltage E(t) as forcing function...
[Series circuit analogue: RLC circuit with nonzero resistance R and nonzero voltage E(t) as forcing function is analogous to a forced damped spring/mass system.] Consider the RLC circuit with inductance L = 8 henrys, resistance R = 16 ohms, capacitance C = 0.025 farads, and voltage E(t) = 17 cos 2t volts. (a) Find the current in the circuit for t > 0, given that at time t = 0 the capacitor is uncharged and there is no current flowing....
USE MATLAB The lump sum S to be paid when interest on a loan is compounded...
USE MATLAB The lump sum S to be paid when interest on a loan is compounded annually is given by where is the principal invested, is the interest rate, and is the number of years. Write a modular program that will plot the amount S as it increases through the years from 1 to n. The main script lumpsum.m will call a function inputyears.m to prompt the user for the number of years (and error-check to make sure that the...
a 10-volt battery connected across a parallel combination of a 100 (ohm) fixed resistor and a...
a 10-volt battery connected across a parallel combination of a 100 (ohm) fixed resistor and a variable resistor R. It can be shown that the total current in the circuit I (in amperes, A) is the following function of the variable resistor R (in ohms): I= ((100+R)/10R) If the variable resistance is decreased at a rate of 5 ohm/s, calculate the rate of change in the current with time when the variable resistance is 50 ohms.
Suppose L=20 henrys, R = 10 ohms, C = 1/200 farads, E = 50 volts, q(0)...
Suppose L=20 henrys, R = 10 ohms, C = 1/200 farads, E = 50 volts, q(0) = 12 coulombs, and q'(0) = l(0) = 0. Formulate and solve an initial value problem that models the given LRC circuit. q(t) = ?
An RC-circuit is attached to a 12.00-volt battery. Itâ s resistance is 6 ohms and its...
An RC-circuit is attached to a 12.00-volt battery. Itâ s resistance is 6 ohms and its relaxation time is 3.03 microseconds. Before continuing, carefully calculate the time when the current was 1.303 A in your notes. Remember units and significant figures! Hey, what would your reaction have been if I had told you that the current was 3 ampere? A. What unit will you be using for your answer? B. How many significant digits should your answer have? C. When...
Write the curve given by r(t)=((3/2)t)i+(t^3/2)j as a function r(s) parameterized by the arc length s...
Write the curve given by r(t)=((3/2)t)i+(t^3/2)j as a function r(s) parameterized by the arc length s from the point where t=0. Write your answer using standard unit vector notation.