Computer Question 1:
Plot and Subplot
You are given the following points, which are given as (x,y) coordinate pairs, with
the y points in scientific notation (4e+010 means 4*10^10):
Write Matlab code that displays the following two graphs next to each other
a) A standard x-y plot of the points
b) A plot of the points where the y axis is logarithmic
Title the graphs (“X-Y Plot” and “Y Logarithmic”).
Also answer, in one sentence, what you learn about the relationship between x
and y as a result of these plots, and suggest a possible equation for y.
x = 20:5:40;
y = [1.2e+009 1.8e+011 2.7e+013 4.0e+015 5.9e+017];
subplot(1,2,1); plot(x,y); title(
subplot(1,2,2); semilogy(x,y); title(
You learn that y is exponentially related to x, so you might have y = e
potentially with constants added in.
-4 if they have minor syntax errors (they had the computer to check answers)
-4 if they are missing titles
-8 if they at least successfully use 2 of the following: subplot, plot, and colon
-10 if they at least successfully use 1 of the following: subplot, plot, and colon
-12 if they seem to kind of understand how to plot things
Computer Question 2:
Write Matlab code that does the following: