GETULCC Finds the upper left element > 0 in a matrix.
Generates a stationary residual from the frequency matrix. |
01 function [row,col,num]=getulcc(M) 02 %GETULCC Finds the upper left element > 0 in a matrix. 03 04 % Does not work if several element lay on a diagonal line and the upper left 05 % element is not unique. 06 07 % Copyright 1993, Mats Frendahl, Dept. of Math. Stat., University of Lund. 08 09 n=length(M); 10 for i=n-1:-1:0 11 index=find(diag(fliplr(M),i)>0); 12 if ~isempty(index) 13 row=index; 14 col=(n-i)-(row-1); 15 num=M(row,col); 16 return 17 end 18 end 19 20
Comments or corrections to the WAFO group