Recitation_204_20Problems-_20Solutions

# Recitation_204_20Problems-_20Solutions - 14:440:127...

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

14:440:127- Introduction to Computers for Engineers Problems for students to attempt in Recitation 4 1) Plot the following functions from x = 0 to 10 a) y = 5e 2x x = 0:0.1:10; plot(x, 5*exp(2*x)) b) y = sin(x) x = 0:0.1:10; plot(x, sin(x)) c) x = sin(y) x = 0:0.1:10; plot(sin(x),x) d) y = x 1/3 x = 0:0.1:10; plot(x, x.^(1/3)) e) y = sin 2 (x) + cos 2 (x) x = 0:0.1:10; plot(x, (sin(x)).^2 + (cos(x)).^2) f) Now plot part d using a red dotted line, and represent the points by circles x = 0:0.1:10; plot(x, x.^(1/3),’:ro’) 2) Plot the following functions from x = 10 to 30 Label the x axis as “Hours Spent on Matlab,” the y axis as “Grade in the Class,” and title each graph with the equation of the function plotted a) y = 6x 3 x=10:0.1:30; plot(x,6*x.^3); xlabel(‘Hours Spent on Matlab’); ylabel(‘Grade in the Class’); title(‘6 x cubed’); b) y = 5x 3 + 6x 2 x=10:0.1:30; plot(x,5*x.^3 + 6*x.^2); xlabel(‘Hours Spent on Matlab’); ylabel(‘Grade in the Class’); title(‘5 x cubed + 6 x squared’); c) y = 4x 3 + 12x 2 + 15x x=10:0.1:30; plot(x,4*x.^3 + 12*x.^2 + 15*x); xlabel(‘Hours Spent on Matlab’); ylabel(‘Grade in the Class’); title(‘4x 3 + 12x 2 + 15x’); d) y = 100x 2 x=10:0.1:30; plot(x,100*x.^2); xlabel(‘Hours Spent on Matlab’); ylabel(‘Grade in the Class’); title(‘100 x squared’); e) Now, graph all four of those equations on the same set of axes. x=10:0.1:30; plot(x, 6*x.^3, x, 5*x.^3 + 6*x.^2, x, 4*x.^3 + 12*x.^2 + 15*x, x, 100*x.^2) f) Now, graph all four of those equations side by side using subplot

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

View Full Document
x=10:0.1:30; subplot(2,2,1); plot(x,6*x.^3); xlabel(‘Hours Spent on Matlab’); ylabel(‘Grade in the Class’); title(‘6 x cubed’); subplot(2,2,2); plot(x,5*x.^3 + 6*x.^2); xlabel(‘Hours Spent on Matlab’);
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

Recitation_204_20Problems-_20Solutions - 14:440:127...

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

View Full Document
Ask a homework question - tutors are online