Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!g22g2000prf.googlegroups.com!not-for-mail
From: TideMan <mulgor@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Help Please! Plotting X,Y,Z 3d surface
Date: Wed, 2 Dec 2009 19:19:01 -0800 (PST)
Organization: http://groups.google.com
Lines: 26
Message-ID: <7fcf6f1b-1976-4b42-af8b-0f41cd83a229@g22g2000prf.googlegroups.com>
References: <6d2b1cd8-5b76-440e-9640-8f9553fa95a9@b15g2000yqd.googlegroups.com>
NNTP-Posting-Host: 202.78.152.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1259810341 15892 127.0.0.1 (3 Dec 2009 03:19:01 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 3 Dec 2009 03:19:01 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: g22g2000prf.googlegroups.com; posting-host=202.78.152.105; 
	posting-account=qPexFwkAAABOl8VUndE6Jm-9Z5z_fSpR
User-Agent: G2/1.0
X-HTTP-Via: 1.1 bc6
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) 
	Gecko/20091102 Firefox/3.5.5,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:589727

On Dec 3, 1:02 pm, sumeho <sum...@gmail.com> wrote:
> Hi!
>
> I have an ascii file with x, y, z (latitude, longitude, elevation).
> Because these are coordinates and I guess the spacing is different, I
> am not able to simply plot (surf).
>
> I've read about using meshgrid for the x and y... I'm also getting an
> error if I just do surf(x,y,z)- not being the same dimensions.
>
> This is lidar data. I want to import the surface into matlab and run a
> hydrodynamic model on the surface elevation.
>
> Thank you!

If your distribution of points is not in a rectangular grid, meshgrid
will not work.
What you need is griddata.
And if you configure it correctly, you'll get exactly the arrays you
need for surf.

Alternatively, since you're plotting latitude and longitude, you may
need to transform them first using a mapping projection (like
Mercator), otherwise the map will be distorted, especially at high
latitudes.  Google m_map to get a (free) toolbox that does that for
you.