From: "John D'Errico" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: shortest distance between a point and vector (n dimension)
Date: Tue, 27 Dec 2011 14:28:08 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 17
Message-ID: <jdcklo$r6$>
References: <jdav08$ru6$> <jdb7g4$lfg$> <jdcc5s$4t0$>
Reply-To: "John D'Errico" <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1324996088 870 (27 Dec 2011 14:28:08 GMT)
NNTP-Posting-Date: Tue, 27 Dec 2011 14:28:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: comp.soft-sys.matlab:753235

"Kevin " <> wrote in message <jdcc5s$4t0$>...
> thank you for your answer! 
> To be frank I am writing a code for genetic algorithm optimization, and I needed this for creating offspring from parents.
> lets assume g was the mean vector of (mou) number of parents .
> and x was one of parents for creating offspring. ( point P was one of the other parents)
> For creating the offspring  I also need (mou-1: other parents excluding x)  orthonormal basis that span the subspace perpendicular to vector d.
> Can i use 'orth' function?? How and if not what do you propose?

No. Read the help. orth gives you an orthonormal basis that
spans a set of vectors. You are apparently asking for a set
of basis vectors that span the null space, so vectors that
are orthogonal to your vector d.

This is the null space you are looking for, so use the function