Math1920_01 - %Sample Matlab Programs %Math 1920 - Spring...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %Sample Matlab Programs %Math 1920 - Spring 2009 %Plot a space-curve (Helix) t=0:0.2:20; %Set values for the parameter. t = x0 : spacing : xf x=cos(t); y=sin(t); z=t; plot3(x,y,z); %plot the curve xlabel('x-axis'); ylabel('y-axis'); zlabel('z-axis'); %label the axis %Plot a space-curve (Spiral-helix) t=0:0.2:20; %Set values for the parameter. x=t.*cos(t); y=t.*sin(t); z=sqrt(t); plot3(x,y,z,'r-*'); %('r-*') r red line, - continuous, * mark each point xlabel('x-axis'); ylabel('y-axis'); zlabel('z-axis'); %label the axis %Plot a plane [x,y]=meshgrid(0:0.2:3,0:0.1:2); %set x and y values by z=3*x+4*y+2; % meshgrid(x_values,y_values) mesh(x,y,z); %plot the surface %Plot a surface [x,y]=meshgrid(-3:0.2:3,-2:0.1:2); %set x and y values z=-x.^2-y.^2+4; mesh(x,y,z);...
View Full Document

Page1 / 2

Math1920_01 - %Sample Matlab Programs %Math 1920 - Spring...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online