Question: This is for my programming class where we are using matlab: In this problem, our goals are to plot the functions y 1 = x
This is for my programming class where we are using matlab:
In this problem, our goals are to plot the functions y1 = x2 and y2 = 2x-1 together and to save the data of the coordinates of all points in the file myplot.dat.
a) (1 pt) Create in an efficient way the column vector x equally spaced from -100 to 100.
b) (2 pts) Create the column vectors y1 and y2.
c) (1 pt) Create matrix mat= [x, y1, y2].
d) (1 pt) Save matrix mat in the data file named myplot.dat.
e) (1 pt) Load the data file myplot.dat and check the data stored inside.
f) (4 pts) Finally, plot the functions y1 = x2 and y2 = 2x-1 together on the same plot with different colors. Remember to label all the axes, add legends, and title the plot.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
