Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to plot a graph with discrete points?
Date: Wed, 23 Sep 2009 09:19:03 +0000 (UTC)
Organization: Michigan Technological University
Lines: 19
Message-ID: <h9cp67$t60$1@fred.mathworks.com>
References: <h97gjp$k4m$1@fred.mathworks.com> <h97q7b$min$1@fred.mathworks.com> <h981c3$9pl$1@fred.mathworks.com> <h9a8kj$ru6$1@fred.mathworks.com> <h9ab4o$2lr$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1253697543 29888 172.30.248.37 (23 Sep 2009 09:19:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 23 Sep 2009 09:19:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 378863
Xref: news.mathworks.com comp.soft-sys.matlab:572274


> > > > > I only have the following data
> > > > > figgg=[x_i,y_i,z_i].
> > > > > for example:
> > > > > x=rand(100,1);
> > > > > y=rand(100,1);
> > > > > z=x.^2+y.^2;
> > > > > figgg=[x,y,z];
> > > > > you can use this figgg for test.

> Yes ,You are right.But I now only have the data  [x_i,y_i,z_i],I don't have the structure.surf need z be a matrix but my z is a vector.Thank you 



Is this what you're looking for?

tri = delaunay(x,y);
h = trisurf(tri, x, y, z);

See <http://www.mathworks.com/matlabcentral/fx_files/5105/1/content/surf_from_scatter.html>, and maybe <http://www.mathworks.com/matlabcentral/fileexchange/8998>.