Home > wafo > cycles > nt2lc.m

# nt2lc

## PURPOSE Calculates the level crossings from a cycle matrix.

## SYNOPSIS lc = nt2lc(param,NT)

## DESCRIPTION ``` NT2LC Calculates the level crossings from a cycle matrix.

CALL:  lc = nt2lc(param,NT);

Input:
param = Parameter vector, [a b n], defines the discretization.
NT    = Coutning distribution. [nxn]
Output;
lc    = a two column matrix with levels and number of upcrossings.

Example:
F0 = round(triu(rand(50),1)*10);
NT = cmat2nt(F0);
param = [-1 1 50];
lc = nt2lc(param,NT);
lcplot(lc)

See also  cmat2nt, cc2cmat```

## CROSS-REFERENCE INFORMATION This function calls:
 levels Calculates discrete levels given the parameter matrix. error Display message and abort function.
This function is called by:
 test_cycles Quick test of the routines in module 'cycles'

## SOURCE CODE ```001 function lc = nt2lc(param,NT)
002 %NT2LC Calculates the level crossings from a cycle matrix.
003 %
004 % CALL:  lc = nt2lc(param,NT);
005 %
006 % Input:
007 %   param = Parameter vector, [a b n], defines the discretization.
008 %   NT    = Coutning distribution. [nxn]
009 % Output;
010 %   lc    = a two column matrix with levels and number of upcrossings.
011 %
012 % Example:
013 %   F0 = round(triu(rand(50),1)*10);
014 %   NT = cmat2nt(F0);
015 %   param = [-1 1 50];
016 %   lc = nt2lc(param,NT);
017 %   lcplot(lc)
018 %
019 % See also  cmat2nt, cc2cmat
020
021 % Tested on Matlab 6.0
022 %
023 % History:
024 % Created by PJ (Pär Johannesson) 18-May-2000
025
026 % Check input arguments
027 ni = nargin;
028 no = nargout;
029 error(nargchk(2,2,ni));
030
031 lc = [levels(param)' diag(NT)];
032```

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group

Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003