To plot the 2D graph of the equation (xy^3)/(1+y^2) = 8/5 in Matlab, follow these steps:
main.m39 chars2 lines
meshgrid
function:main.m28 chars2 lines
This generates a grid of x and y points ranging from -5 to 5 with a spacing of 0.1.
main.m14 chars2 lines
contour
or contourf
function:main.m56 chars5 lines
or
main.m55 chars5 lines
The contourf
function will create a filled-in contour map, while contour
will create a contour map without fill.
The 20
parameter specifies the number of contour levels to display.
The xlabel
, ylabel
, and colorbar
functions are optional and can be used to label the axes and add a colorbar to the graph.
gistlibby LogSnag