Answered step by step
Verified Expert Solution
Question
1 Approved Answer
answer this matlab problem statement and work through each point of the problem. Please work this out in MATLAB only! Thanks! Problem statement: The RC
answer this matlab problem statement and work through each point of the problem. Please work this out in MATLAB only! Thanks!
Problem statement:
The RC circuit shown is composed of a resistor, a capacitor, and a DC voltage source:
where and The voltage on the capacitor
gradually increases when the switch is closed. Theoretically, as a function of time is given by:
Goal: Create a plot of voltage vs time
Write a function program the following features template provided:
a Name the function voltageTheo.
b Name the input argument to the function as time and the output argument as voltage.
c Assign the values for and to the variables V R and respectively.
d Using the equation given above, the function calculates the theoretical voltage voltage
for each value of time time Use elementwise operations as needed.
Write a script program that performs the following template provided:
a Create a row vector with equally spaced values for time from to Assign the vector
to the variable theo.
b Call the function voltageTheo with theo as the input and assign the output to theo.
c Create a plot of voltage vs time for the theoretical data as a solid red line
d Label the horizontal axis as "Time, s and the vertical axis as "Voltage, VC V
e Add a title to the plot that reads "Plot of the capacitor voltage for an circuit."
Submit:
Each of your programs function and script as separate mfiles. Do not submit the plot.
A single docxfile containing both programs function and script Do not submit the plot.
Extracredit : Use MATLAB's "Publish" feature to create a PDF file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started