DCC2CMAT Calculates the cycle matrix for a discrete cycle count. CALL: F = dcc2cmat(dcc,n); F = Cycle matrix dcc = a two column matrix with a discrete cycle count. n = Number of discrete levels. The discrete cycle count takes values from 1 to n. A cycle count is transformed into a discrete cycle count by using the function CC2DCC. See also cc2cmat, cc2dcc, cmatplot
Calculates the cycle count matrix from a cycle count. | |
Script to computer exercises 4 | |
Quick test of the routines in module 'cycles' |
001 function F = dcc2cmat(dcc,n) 002 % DCC2CMAT Calculates the cycle matrix for a discrete cycle count. 003 % 004 % CALL: F = dcc2cmat(dcc,n); 005 % 006 % F = Cycle matrix 007 % dcc = a two column matrix with a discrete cycle count. 008 % n = Number of discrete levels. 009 % 010 % The discrete cycle count takes values from 1 to n. 011 % 012 % A cycle count is transformed into a discrete cycle count by 013 % using the function CC2DCC. 014 % 015 % See also cc2cmat, cc2dcc, cmatplot 016 017 % Tested on Matlab 5.3 018 % 019 % History: 020 % Revised by PJ 12-Jan-2000 021 % Corrected help text 022 % Revised by PJ (Pär Johannesson) 01-Nov-1999 023 % updated for WAFO 024 % Copied from WAT Ver. 1.2 025 026 F=zeros(n); 027 k=length(dcc); 028 for i=1:k, 029 F(dcc(i,1),dcc(i,2)) = F(dcc(i,1),dcc(i,2))+1; 030 end 031 032
Comments or corrections to the WAFO group