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

  1. Newsgroups: comp.soft-sys.matlab
  2. Path: sparky!uunet!stanford.edu!nntp.Stanford.EDU!forsythe.stanford.edu!nova!maurer
  3. From: Michael Maurer <maurer@nova.stanford.edu>
  4. Subject: Re: Help! Plotting.
  5. Message-ID: <maurer.727998312@nova.Stanford.EDU>
  6. Sender: news@leland.Stanford.EDU (Mr News)
  7. Organization: STAR Lab, Stanford University, California USA
  8. References: <1993Jan24.233400.1494@jupiter.sun.csd.unb.ca>
  9. Date: 25 Jan 93 21:45:12 GMT
  10. Lines: 23
  11.  
  12. In <1993Jan24.233400.1494@jupiter.sun.csd.unb.ca> dwoo@jupiter.sun.csd.unb.ca (Dennis Woo) writes:
  13.  
  14. >I entered the following lines in matlab:
  15. >    
  16. >  [w0,w1]=meshdom(-5:.1:5,-5:.1:5);
  17. >  z = 2*(w0.^2) + 3*(w1.^2) - 12*w0 - 8*w1 
  18. >      + 2*(w0.*w1) + 36*ones(w0);
  19. >  contour(z)
  20.  
  21. >Instead of contours (these contours are ellipses) centered at (2.8,0.4)
  22. >with a z-value of 17.6,  I got the contours centered at around
  23. >(85,60).
  24.  
  25. Your mistake is to omit the axes specifications to 'contour'.  Without
  26. these, 'contour' will use the indices into the array 'z' as the x- and
  27. y-axes.  Instead you should say
  28.  
  29. contour(z,-5:.1:5,-5:.1:5)
  30.  
  31. Good luck.
  32. --
  33. ______________________________________________________________________
  34. Michael Maurer          maurer@nova.stanford.edu        (415) 723-1024
  35.