% % contour plot example -- lect01a.m % - to run, type "lect01a" at the matlab prompt % % - to get browser help, access "helpdesk" % from the menu of any plot! % - to get in-line help for a command "xyz", % type "help xyz" at the matlab prompt % %- - - - - - - - - - - - - - - - - - - - - - - - a = 1.2; b = 0.5; u = -2:0.01:2; up = u; % matrices of values [u1 u2] = meshgrid(u,up); k = 0.5*(u2.^2) - ((b/4)*(u1.^4) - (a/2)*(u1.^2)); % contourplot hpi = pi/2; co = - ((b/4)*(hpi^4) - (a/2)*(hpi^2)); cont = [0:co/5:4*co]; contour(u,up,k,cont) title('\bf phase plane') xlabel('\bf u') ylabel('\bf u \prime')