help-octave
[Top][All Lists]
Advanced

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

index generation of nearest neighbour for n-dimensional cube


From: Poul-Erik Hansen
Subject: index generation of nearest neighbour for n-dimensional cube
Date: Fri, 05 Dec 2003 17:58:11 +0100 (CET)
User-agent: IMP/PHP IMAP webmail program 2.2.6

Hi

Is there a command similar to matlabs ndgrid in octave?
I need a method for finding the nearest neighbours to a point in n-dimensional
Euclidan space, illustrated below for a two dimensional example.
point=(5,6)
[x,y]=meshgrid(-1:1,-1:1)
x=x(:)+pos(1);
y=y(:)+pos(2);
Nearst Neighbors=[x,y]

How do you generalize this code to N dimension?

Thanks

Poul-Erik



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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