10-26 CW

# 10-26 CW - axis[1 4 0 10 subplot(2,2,2...

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

Jaspal Singh 10-26-10 Section 9202 problem #1 %page 271 5.2 Subplots and Overlay Plots x=[0:0.01:5]; y=exp(-1.2*x).*sin(10*x+5); subplot(1,2,1) plot(x,y),xlabel('x'),ylabel('y'),axis([0 5 -1 1]) x=[-6:0.1:6] y=abs(x.^3-100); subplot(1,2,2) plot(x,y),xlabel('y'),axis([-6 6 0 350])

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

View Full Document
Problem 2 %pg 275 Labeling Curves and Data x=[1:0.01:2]; y=sinh(x); z=tanh(x); plot(x,y,'g*',x,z,'r--'),xlabel('x'),. .. ylabel('Hyperbolic Sine and Tangent'),. .. legend('sinh(x)','tanh(x)')
Problem 3 %page 285 5.3-3 %two data sets plotted on four types of plots x=[1,1.5,2,2.5,3,3.5,4]; y1=[4,3.14,2.67,2.34,2.1,1.92,1.78]; y2=[8.8,7.02,5.57,4.43,3.52,2.8,2.22]; subplot(2,2,1) %'o' is for the points on the figure (see list page 273 5.2-1 chart) %we write x,y1 twice becuase without it there would be no line just ano plot(x,y1,x,y1,'o',x,y2,x,y2,'x'),xlabel('x'),ylabel('y')

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: axis([1 4 0 10]) subplot(2,2,2) semilogy(x,y1,x,y1,'o',x,y2,x,y2,'x'),xlabel('x'),ylabel('y') subplot(2,2,3) semilogx(x,y1,x,y1,'o',x,y2,x,y2,'x'),xlabel('x'),ylabel('y') subplot(2,2,4) loglog(x,y1,x,y1,'o',x,y2,x,y2,'x'),xlabel('x'),ylabel('y') axis([1 4 1 10]) BAR FUNCTION %Relative frequency histogram using the bar function. tests=100; y=[13,15,22,19,17,14]/tests; x=[91:96]; bar(x,y),ylabel('Relative Frequency'),xlabel('Thread Strength(N)') title('Relative Frequency Histogram for 100 Tests') >> %surface plots: [X,Y]=meshgrid(-2:0.1:2); Z= X.*exp(-((X-Y.^2).^2+Y.^2)); mesh(X,Y,Z),xlabel('x'),ylabel('y'),zlabel('z') . %surface plots: [X,Y]=meshgrid(-2:0.1:2); Z= X.*exp(-((X-Y.^2).^2+Y.^2)); contour(X,Y,Z),xlabel('x'),ylabel('y'),zlabel('z') grid on This is with surf...
View Full Document

{[ snackBarMessage ]}

### Page1 / 6

10-26 CW - axis[1 4 0 10 subplot(2,2,2...

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

View Full Document
Ask a homework question - tutors are online