help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plotting a simple function in 3D?


From: Martin Helm
Subject: Re: Plotting a simple function in 3D?
Date: Sat, 4 Dec 2010 18:13:42 +0100
User-agent: KMail/1.13.5 (Linux/2.6.34.7-0.5-desktop; KDE/4.5.4; x86_64; ; )

Am Samstag, 4. Dezember 2010, 17:29:12 schrieb loinen:
> Hello, I would appreciate a little help here.
> I'm trying to plot a simple function alpha=sqrt(3)*h/l
> where h and l are vectors containing integers 0..100
> I would like to plot the function where h and l are axis. Sounds very
> simple but after many hours spent searching for help... still there's
> none. BTW, the function models the angle an object dropping from a desk
> will land on a floor.
> Thanks for the help.

Do you mean something like that?

octave:1> h = 0:100;
octave:2> l = 0:100;
octave:3> [hh, ll] = meshgrid(h, l);
octave:4> alpha = sqrt(3) .* hh ./ ll;
octave:5> surf(hh, ll, alpha)

The keywords you have to lookup for such function plotting are meshgrid and 
surf (and maybe mesh if you prefer that instead of surf).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]