Here's how you can graph the function f(x1,x2) = -(x1/2) - (3*x2 / 2)
using contour function in matlab:
main.m35 chars2 lines
meshgrid
function:main.m44 chars2 lines
main.m14 chars2 lines
contour
function to create a contour plot:main.m46 chars4 lines
This will create a contour plot of the function f(x1,x2) = -(x1/2) - (3*x2 / 2)
.
Note: Contour plots show the level sets of the function on the 3D graph.
gistlibby LogSnag