🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.soft-sys.matlab
Article #38

Help! Plotting.

#38
From: Dennis Woo
Date: Sun, 24 Jan 1993 23:34
31 lines
1315 bytes
Hi Matlab expert,

I am trying to make a contour plot of a hyperparaboloid of a
two-variable function. The equation look like this:

 z = 2*w0^2 + 3*w1^2 - 12*w0 - 8*w1 + 2*w0*w1 + 36

The minimum of z(w0,w1) is z(2.8,0.4)=17.6.

I entered the following lines in matlab:
	
  [w0,w1]=meshdom(-5:.1:5,-5:.1:5);
  z = 2*(w0.^2) + 3*(w1.^2) - 12*w0 - 8*w1 
      + 2*(w0.*w1) + 36*ones(w0);
  contour(z)

Instead of contours (these contours are ellipses) centered at (2.8,0.4)
with a z-value of 17.6,  I got the contours centered at around
(85,60).

Could someone please let me know what I have done wrong.

Thanx a lot. 

New Matlab user,
*****************************************************************
*  Dennis Woo              Department of Mechanical Engineering *
*  E-mail: dwoo@unb.ca     University of New Brunswick          *
*  Tel: (506) 453-4513                                          *
*****************************************************************	
Technical Details
Message-ID: <1993Jan24.233400.1494@jupiter.sun.csd.unb.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!csd.unb.ca!dwoo

Show Full Headers
Complete Article Headers
Newsgroups: comp.soft-sys.matlab
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!csd.unb.ca!dwoo
From: dwoo@jupiter.sun.csd.unb.ca (Dennis Woo)
Subject: Help! Plotting.
Message-ID: <1993Jan24.233400.1494@jupiter.sun.csd.unb.ca>
Organization: University of New Brunswick
Date: Sun, 24 Jan 1993 23:34:00 GMT
Lines: 31