## Bug in Matlab 5.0 phase.m ???

### Bug in Matlab 5.0 phase.m ???

Hello

Is this a bug in Matlab 5.0's implementation of phase.m??

??? Error using ==> +
Matrix dimensions must agree.

Error in ==> /usr/local/matlab/toolbox/ident/phase.m
On line 20  ==> PHI=PHI+2*pi*sign(DF(i))*[zeros(1,i) ones(1,N-i)];

You can do the following step to get the above error:

1. Goto matlab/toolbox/matlab/demos
3. X_FFT =  fft(X);
4. phase(X_FFT);

The matrix is 176x260       732160  double array (complex).
I have tested on smaller matrix and the function works fine.
Only the big matrix have this problem.

Thank You

--- YONG ---

### Bug in Matlab 5.0 phase.m ???

The problem comes from the fact that the function PHASE expects a row
vector input, while X_FFT is a 176x260 matrix. Since fft computes the
FFT of each column of X, you need to apply PHASE to each column
of the result X_FFT:

for col = X_FFT
phase(col')
end

- pascal

> Hello

>         Is this a bug in Matlab 5.0's implementation of phase.m??

> ??? Error using ==> +
> Matrix dimensions must agree.

> Error in ==> /usr/local/matlab/toolbox/ident/phase.m
> On line 20  ==> PHI=PHI+2*pi*sign(DF(i))*[zeros(1,i) ones(1,N-i)];

>         You can do the following step to get the above error:

> 1. Goto matlab/toolbox/matlab/demos
> 3. X_FFT =  fft(X);
> 4. phase(X_FFT);

> The matrix is 176x260       732160  double array (complex).
> I have tested on smaller matrix and the function works fine.
> Only the big matrix have this problem.

> Thank You

>                                                         --- YONG ---

Hello

I encountered the following message after using the phase function:

??? Error using ==> +
Matrix dimensions must agree.

Error in ==> /usr/local/matlab/toolbox/ident/phase.m
On line 20  ==> PHI=PHI+2*pi*sign(DF(i))*[zeros(1,i) ones(1,N-i)];

To recreate the above error:

goto matlab/toolbox/demos/