This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Computer Question 1: Plot Write Matlab code that displays the following four graphs next to each other (in one figure) as seen below. Let x contain 100 evenly spaced points, running from 1 to 10. Title and label both the x and y axes of your graph. a) y = log(x) b) y = e x c) y = e x+5 d) y = cos 2 (x) x = linspace(0,10,100); subplot(2,2,1); plot(x, log(x)); title(log x); xlabel(x); ylabel(y); subplot(2,2,2); plot(x, exp(x)); title(e to the x); xlabel(x); ylabel(y); subplot(2,2,3); plot(x, exp(x+5)); title(e to the x+5); xlabel(x); ylabel(y); subplot(2,2,4); plot(x, cos(x).^2); title(cosine squared); xlabel(x); ylabel(y); 4 if they have minor syntax errors (they had the computer to check answers) 6 if they are missing titles, xlabels, and/or ylabels, or cant dot multiply/exponentiate 8 if they at least successfully use 2 of the following: subplot, plot, and linspace 10 if they at least successfully use 1 of the following: subplot, plot, and linspace 12 if they seem to kind of understand how to plot things...
View Full
Document
 Fall '09
 blase

Click to edit the document details