Task 2 The relationship between the voltage applied across a resistor and the current flowing through the resistor is given by Ohm's law, which can be expressed in the following mathematical form: V=IX R Where: • V is the voltage across the resistor (volts), ⚫ I is the current flowing through the resistor (amperes), • R is the resistance (ohms). V R The following table gives data for the current flowing through a resistor: S. No. Current 1 0.1 83。2 3 4 5 6 7 0.2 0.5 1.0 1.5 20 30 50 75 8 9 10 10.0 (Amperes) a) Write a script that will prompt the user for the value of the resistance and determine the voltage across the resistor for each current in the table. The script will print the result for each current in the following tabular format: Example: S.No. Current (Amperes) Voltage (Volts) 1 0.1 1.0 2. 0.5 2.0 10. 10.0 100.0 b) Plot Voltage vs Current for the given resistance. c) Prompt the user a second time for a different value of resistance and plot the voltage vs current in the same graph as in part (b) for both resistances. (Hint: Use the subplot command and don't forget to label your graphs) Page VI of 9
Task 2 The relationship between the voltage applied across a resistor and the current flowing through the resistor is given by Ohm's law, which can be expressed in the following mathematical form: V=IX R Where: • V is the voltage across the resistor (volts), ⚫ I is the current flowing through the resistor (amperes), • R is the resistance (ohms). V R The following table gives data for the current flowing through a resistor: S. No. Current 1 0.1 83。2 3 4 5 6 7 0.2 0.5 1.0 1.5 20 30 50 75 8 9 10 10.0 (Amperes) a) Write a script that will prompt the user for the value of the resistance and determine the voltage across the resistor for each current in the table. The script will print the result for each current in the following tabular format: Example: S.No. Current (Amperes) Voltage (Volts) 1 0.1 1.0 2. 0.5 2.0 10. 10.0 100.0 b) Plot Voltage vs Current for the given resistance. c) Prompt the user a second time for a different value of resistance and plot the voltage vs current in the same graph as in part (b) for both resistances. (Hint: Use the subplot command and don't forget to label your graphs) Page VI of 9
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter3: Assignment, Formatting, And Interactive Input
Section: Chapter Questions
Problem 6PP: (Heat transfer) The formula developed in Exercise 5 can be used to determine the cooling time, t,...
Question
Please help me Matlab don't use AI
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning