% We can draw from predefined primitives % and assemble the pieces into one drawing. [x,y,z] = sphere(10); mesh(x,y,z) [x,y,z] = cylinder(30); hold on mesh(x,y,z) % The argument of the cylinder is by default % the radius and the axis of the cylinder is % by default the z-axis. % To make the cylinder taller, we multiply the % z-coordinates by 30 z1 = 30*z; figure mesh(x,y,z1) hold on mesh(x,y,z) % to flip the axis of orientation, % we interchange z with x or y mesh(x,z1,y) % we can shift the axis mesh(x,z1+15,y) % the previous command heightened, % to shift the axis, try y + 15: mesh(x,z1,y+15) mesh(1+x1,y1,z1) hold on mesh(x,y,z) mesh(x1,y1,1+z1) % we can make curve walls % For example, we can use a parabola % y = x^2 as the wall. t = 0:0.01:1; p = t.^2; figure [x,y,z] = cylinder(p); mesh(x,y,z) q = sqrt(t); [x,y,z] = cylinder(q); hold on mesh(x,y,z); % % We are going to make a script % to model with splines help spline defines a profile usespline figure usespline clf usespline usespline usespline usespline usespline diary off