Path: news.mathworks.com!not-for-mail
From: "zedong 
" <zdongwu@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to plot a graph with discrete points?
Date: Tue, 13 Oct 2009 14:36:04 +0000 (UTC)
Organization: &#20013;&#22269;&#31185;&#23398;&#38498;&#25968;&#23398;&#19982;&#31995;&#32479;&#31185;&#23398;&#30740;&#31350;&#38498;
Lines: 22
Message-ID: <hb238k$bi2$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> <h9cp67$t60$1@fred.mathworks.com>
Reply-To: "zedong 
" <zdongwu@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1255444564 11842 172.30.248.38 (13 Oct 2009 14:36:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 13 Oct 2009 14:36:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1639198
Xref: news.mathworks.com comp.soft-sys.matlab:576979


"arich82 " <|a|r|i|c|8|2|@hotmail.com> wrote in message <h9cp67$t60$1@fred.mathworks.com>...
> > > > > > 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>.

Thank you very much.That must be the best solution.I have never thought about it.Very beautiful