home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / softsys / matlab / 138 < prev    next >
Encoding:
Text File  |  1993-01-24  |  1.2 KB  |  41 lines

  1. Newsgroups: comp.soft-sys.matlab
  2. Path: sparky!uunet!cs.utexas.edu!torn!csd.unb.ca!dwoo
  3. From: dwoo@jupiter.sun.csd.unb.ca (Dennis Woo)
  4. Subject: Help! Plotting.
  5. Message-ID: <1993Jan24.233400.1494@jupiter.sun.csd.unb.ca>
  6. Organization: University of New Brunswick
  7. Date: Sun, 24 Jan 1993 23:34:00 GMT
  8. Lines: 31
  9.  
  10.  
  11. Hi Matlab expert,
  12.  
  13. I am trying to make a contour plot of a hyperparaboloid of a
  14. two-variable function. The equation look like this:
  15.  
  16.  z = 2*w0^2 + 3*w1^2 - 12*w0 - 8*w1 + 2*w0*w1 + 36
  17.  
  18. The minimum of z(w0,w1) is z(2.8,0.4)=17.6.
  19.  
  20. I entered the following lines in matlab:
  21.     
  22.   [w0,w1]=meshdom(-5:.1:5,-5:.1:5);
  23.   z = 2*(w0.^2) + 3*(w1.^2) - 12*w0 - 8*w1 
  24.       + 2*(w0.*w1) + 36*ones(w0);
  25.   contour(z)
  26.  
  27. Instead of contours (these contours are ellipses) centered at (2.8,0.4)
  28. with a z-value of 17.6,  I got the contours centered at around
  29. (85,60).
  30.  
  31. Could someone please let me know what I have done wrong.
  32.  
  33. Thanx a lot. 
  34.  
  35. New Matlab user,
  36. *****************************************************************
  37. *  Dennis Woo              Department of Mechanical Engineering *
  38. *  E-mail: dwoo@unb.ca     University of New Brunswick          *
  39. *  Tel: (506) 453-4513                                          *
  40. *****************************************************************    
  41.