function YorN = validwavcoords(w) % FUNCTION: validwavcoords Part of DPWT Toolbox % % SYNOPSIS: YORN = validwavcoords(W) % % DESCRIPTION: validwavcoords determines whether W is % a vector with length equal to an integer % power of 2. If there is something wrong % with W, messages are printed to the % command window telling what is wrong. % % EXAMPLE: validwavcoords([1 2 3]) % validwavcoords: Length of arg must be 2^integer. % ans = % 0 % validwavcoords([1 2 3 4]) % ans = % 1 % % AUTHOR: Neil Getz % DATE: 2-12-92 % % COPYRIGHT 1992, Neil Getz % if(nargin~=1), help validwavcoords; return; end; [r,c] = size(w); if (r-1)*(c-1), fprintf('validwavcoords: Coordinates must be a vector.'); YorN = 0; return; end; p = log(length(w))/log(2); if ( p ~= round(p) ), s = ['validwavcoords: Length of coord vector',... 'must be 2^integer.']; fprintf(s); YorN = 0; return; end; YorN = 1;