The current and voltage data are recorded below every 5 seconds for 1 minute (called a minute test): time 5:5:60; current = [16 25 32 40 45 47 44 40 33 26 20 11]; voltage = [2 5 4.5 4.7 5.5 5.4 4.2 3.9 3.3 3 2.8 2.1]; Write a script to first check if the lengths of the vectors are the same or not, display an error message. If the lengths of the vectors are not the same, then they can't represent data points, so an error message should be printed. Then it uses quadratic equation to model both the current and voltage data as a function of time. The script will plot both sets of data points and the predicted models on the same graph with labelled axes and a legend. Use "red circle" to represent the current data points and "blue cross" to represent the voltage data points. Any built-in functions, loops and conditional statements can be used. Use the following MATLAB syntax to assist you in obtaining your plots: b blue g green о point circle r red X x-mark C cyan + plus m magenta * star y yellow S square k black d W white V diamond triangle (down) ^ triangle (up) < triangle (left) > triangle (right) p pentagram h hexagram : solid dotted dashdot none) dashed no line b) A student would like to determine when the voltage would reach its maximum value during the minute test (i.e. within the 60 seconds) according to the fitting curve. Your task is to write a script that helps the student to determine the exact time within that minute when the current reaches its maximum value.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
code in matlab
The current and voltage data are recorded below every 5 seconds for 1 minute (called a minute
test):
time 5:5:60;
current = [16 25 32 40 45 47 44 40 33 26 20 11];
voltage = [2 5 4.5 4.7 5.5 5.4 4.2 3.9 3.3 3 2.8 2.1];
Write a script to first check if the lengths of the vectors are the same or not, display
an error message. If the lengths of the vectors are not the same, then they can't
represent data points, so an error message should be printed. Then it uses quadratic
equation to model both the current and voltage data as a function of time. The
script will plot both sets of data points and the predicted models on the same graph
with labelled axes and a legend. Use "red circle" to represent the current data
points and "blue cross" to represent the voltage data points. Any built-in functions,
loops and conditional statements can be used.
Use the following MATLAB syntax to assist you in obtaining your plots:
b
blue
g
green
о
point
circle
r
red
X
x-mark
C
cyan
+
plus
m
magenta
*
star
y
yellow
S
square
k
black
d
W
white
V
diamond
triangle (down)
^
triangle (up)
<
triangle (left)
>
triangle (right)
p
pentagram
h
hexagram
:
solid
dotted
dashdot
none)
dashed
no line
b) A student would like to determine when the voltage would reach its maximum value
during the minute test (i.e. within the 60 seconds) according to the fitting curve.
Your task is to write a script that helps the student to determine the exact time
within that minute when the current reaches its maximum value.
Transcribed Image Text:The current and voltage data are recorded below every 5 seconds for 1 minute (called a minute test): time 5:5:60; current = [16 25 32 40 45 47 44 40 33 26 20 11]; voltage = [2 5 4.5 4.7 5.5 5.4 4.2 3.9 3.3 3 2.8 2.1]; Write a script to first check if the lengths of the vectors are the same or not, display an error message. If the lengths of the vectors are not the same, then they can't represent data points, so an error message should be printed. Then it uses quadratic equation to model both the current and voltage data as a function of time. The script will plot both sets of data points and the predicted models on the same graph with labelled axes and a legend. Use "red circle" to represent the current data points and "blue cross" to represent the voltage data points. Any built-in functions, loops and conditional statements can be used. Use the following MATLAB syntax to assist you in obtaining your plots: b blue g green о point circle r red X x-mark C cyan + plus m magenta * star y yellow S square k black d W white V diamond triangle (down) ^ triangle (up) < triangle (left) > triangle (right) p pentagram h hexagram : solid dotted dashdot none) dashed no line b) A student would like to determine when the voltage would reach its maximum value during the minute test (i.e. within the 60 seconds) according to the fitting curve. Your task is to write a script that helps the student to determine the exact time within that minute when the current reaches its maximum value.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education