"A " <email@example.com> wrote in message news:firstname.lastname@example.org... > "Torsten" wrote in message <email@example.com>... >> "Bruno Luong" <firstname.lastname@example.org> wrote in message >> <email@example.com>... >> > "A " <firstname.lastname@example.org> wrote in message >> > <email@example.com>... >> > >> > > >> > > It did not work with me. It says that there is no matching between >> > > the inner matrix! >> > >> > I bet there is no matching between what you post and what you test on >> > your side. >> > >> > Bruno >> >> Looks as if the OP's vectors are row vector. not column vectors. >> Otherwise I don't see why X_orth*Y' >> should give a scalar. >> >> Best wishes >> Torsten. > > It works with me !! > > but I thought the result Should be zero ?
In an ideal world, yes it should be exactly zero. The real world is not ideal. In the real world, it should be close to zero for some definition of close.
> Is there another way or making X'*Y=0
Going to arbitrary precision arithmetic calculations using Symbolic Math Toolbox may do what you're asking for, but you will suffer a performance hit for doing so. Better ...
> Since I am entering these in a program that evaluate orthogonality and > should find it equals 0
modify the program that evaluates the orthogonality to count results that are "close enough" to 0 as orthogonal. The definition of "close enough" is up to you.