Can't compare the norm of a vector to 1 in matlab

Posted by Ian on Stack Overflow See other posts from Stack Overflow or by Ian
Published on 2010-05-09T21:40:34Z Indexed on 2010/05/10 0:48 UTC
Read the original article Hit count: 372

Filed under:

I'm trying to find out wether a matrix is orthonormal. I begin by checking if the vectors are normal by doing

for j=1:2;
    if norm(S:,j) ~= 1;
        return; % Not normal vector
    end
end

But when norm returns 1.0000 comparing that to 1 is true and the function returns, which is not what i want. Any ideas?

Thx

© Stack Overflow or respective owner

Related posts about matlab