CC2AMP Calculates the amplitudes from a cycle count. CALL: amp = cc2amp(cc); amp = a vector with amplitudes. cc = a two column matrix with cycles. The amplitude of a cycle is defined as (Max-min)/2 Example: x=load('sea.dat'); TP = dat2tp(x); [mM,Mm] = tp2mm(TP); amp = cc2amp(mM); whisto(amp); See also dat2tp, tp2rfc, tp2mm
Display message and abort function. |
% CHAPTER4 contains the commands used in Chapter 4 of the tutorial | |
Script to computer exercises 1 | |
Quick test of the routines in module 'cycles' |
001 function [amp]=cc2amp(cc) 002 %CC2AMP Calculates the amplitudes from a cycle count. 003 % 004 % CALL: amp = cc2amp(cc); 005 % 006 % amp = a vector with amplitudes. 007 % cc = a two column matrix with cycles. 008 % 009 % The amplitude of a cycle is defined as (Max-min)/2 010 % 011 % Example: 012 % x=load('sea.dat'); TP = dat2tp(x); 013 % [mM,Mm] = tp2mm(TP); 014 % amp = cc2amp(mM); 015 % whisto(amp); 016 % 017 % See also dat2tp, tp2rfc, tp2mm 018 019 % Tested on Matlab 6.0 020 % 021 % History: 022 % Revised by jr 01-Apr-2001 023 % - histo-> whisto in example 024 % - minor changes help text 025 % Corrected by PJ 09-Dec-1999 026 % Now calculates amplitudes (before ranges) 027 % Created by PJ (Pär Johannesson) 01-Nov-1999 028 029 % Check input arguments 030 031 ni = nargin; 032 no = nargout; 033 error(nargchk(1,1,ni)); 034 035 % Calculate amplitudes 036 037 amp = (cc(:,2)-cc(:,1))/2; 038 %amp = abs(cc(:,2)-cc(:,1)); 039
Comments or corrections to the WAFO group