B- Computer Questions- Solutions and RubricExam 1

# B- Computer Questions- Solutions and RubricExam 1 -...

This preview shows pages 1–3. Sign up to view the full content.

Computer Question 1: Plot and Subplot 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 0 to 10. Title and label both the x and y axes of your graph. a) y = x 2 b) y = x 3 c) y = (x- 5) 3 d) y = x x = linspace(0,10,100); subplot(2,2,1); plot(x, x.^2); title(‘x squared’); xlabel(‘x’); ylabel(‘y’); subplot(2,2,2); plot(x, x.^3); title(‘x cubed’); xlabel(‘x’); ylabel(‘y’); subplot(2,2,3); plot(x, (x-5).^3); title(‘x - 5 cubed’); xlabel(‘x’); ylabel(‘y’); subplot(2,2,4); plot(x, sqrt(x)); title(‘sqrt of x’); 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 -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 -14 otherwise Computer Question 2: Even Integers Write Matlab code that does the following:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Ask the user to input a number. (You can assume they’ve entered a number,
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/29/2012 for the course 440 127 taught by Professor Blase during the Fall '09 term at Rutgers.

### Page1 / 4

B- Computer Questions- Solutions and RubricExam 1 -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online