how to plot rabbit in matlab

To plot a rabbit in Matlab, you can use the following code:

main.m
[x,y,z] = sphere;
surf(x*0.5+0.5,y*0.5+0.5,z*0.5+0.5)
axis equal
view(45,30)
colormap(gray)
light('Position',[-1 -1 0.5],'Style','local')
material shiny
153 chars
8 lines

This code creates a sphere, scales it down and positions it to resemble a rabbit. The axis equal command ensures that the scales of the x, y and z coordinates are the same, and the view command sets the angle from which the plot is viewed. The colormap command sets the color map of the plot to grayscale, and the light command adds a light source to the plot. Finally, the material command sets the material properties of the plot object to 'shiny'.

Once this code is executed in Matlab, you will see a 3D plot of a rabbit.

related categories

gistlibby LogSnag