Home > wafo > cycles > cocc.m

cocc

PURPOSE ^

Plots cycles as points together with isolines of a cycle matrix.

SYNOPSIS ^

cocc(param,cc,matrix,clevels,fs)

DESCRIPTION ^

 COCC Plots cycles as points together with isolines of a cycle matrix. 
  
  CALL: cocc(param,cc,matrix) 
        cocc(param,cc,matrix,clevels,psize) 
  
         param   = the parameter matrix. 
         cc      = a two column matrix with cycles. 
         matrix  = an  nxn  matrix. 
         clevels = a vector with levels of isolines. 
         psize   = point size, (defult value is 12). 
  
  Plots cycles of min- and max-values as a point process in the plane 
   together with isolines of an input matrix. 
  
  Example: 
    x=load('sea.dat'); 
    tp = dat2tp(x); 
    rfc = tp2rfc(tp,'CS');           % Rainflow cycles 
    RFM = dat2rfm(x,0,[-3 3 100]);  % Rainflow matrix 
    ERFM = rfmextrapolate(RFM);     % Extrapoalted RFM 
    cocc([-3 3 100],rfc,RFM); 
    cocc([-3 3 100],rfc,ERFM); 
  
  See also  cmatplot, ccplot

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function cocc(param,cc,matrix,clevels,fs) 
002 %COCC Plots cycles as points together with isolines of a cycle matrix. 
003 % 
004 % CALL: cocc(param,cc,matrix) 
005 %       cocc(param,cc,matrix,clevels,psize) 
006 % 
007 %        param   = the parameter matrix. 
008 %        cc      = a two column matrix with cycles. 
009 %        matrix  = an  nxn  matrix. 
010 %        clevels = a vector with levels of isolines. 
011 %        psize   = point size, (defult value is 12). 
012 % 
013 % Plots cycles of min- and max-values as a point process in the plane 
014 %  together with isolines of an input matrix. 
015 % 
016 % Example: 
017 %   x=load('sea.dat'); 
018 %   tp = dat2tp(x); 
019 %   rfc = tp2rfc(tp,'CS');           % Rainflow cycles 
020 %   RFM = dat2rfm(x,0,[-3 3 100]);  % Rainflow matrix 
021 %   ERFM = rfmextrapolate(RFM);     % Extrapoalted RFM 
022 %   cocc([-3 3 100],rfc,RFM); 
023 %   cocc([-3 3 100],rfc,ERFM); 
024 % 
025 % See also  cmatplot, ccplot 
026  
027  
028 % Copyright (c) 2003 by Pär Johannesson 
029  
030 % Tested  on Matlab  6.5 
031 % 
032 % History: 
033 % Created from old version of WAFO (Jan-2001) 
034 % Updated by PJ 03-Jun-2003 
035  
036 % Check input arguments 
037  
038 if nargin<5 
039   fs=[]; 
040 end 
041  
042 if nargin<4   
043   clevels=[]; 
044 end 
045  
046 if isempty(fs) 
047   fs=12; 
048 end 
049  
050 if isempty(clevels) 
051   fmax=max(max(matrix)); 
052   clevels=fmax*[0.005 0.01 0.02 0.05 0.1 0.2 0.4 0.6 0.8]; 
053 end 
054  
055 F = matrix'; 
056 u=levels(param); 
057 contour(u,u,F,clevels,'r') 
058 axis('square')   
059  
060 hold on 
061 if ~isempty(cc) 
062   plot(cc(:,1),cc(:,2),'.','markersize',fs)  % PJ 970415 
063 end 
064 plot(param(1:2),param(1:2),'k--') 
065 hold off 
066 xlabel('min') 
067 ylabel('Max') 
068  
069  clevels=sort(clevels); 
070  n_clevels=length(clevels); 
071  if n_clevels>12 
072    disp('   Only the first 12 levels will be listed in table.') 
073    n_clevels=12; 
074  end 
075  
076 textstart_x=0.65; 
077 textstart_y=0.45; 
078 delta_y=1/33; 
079 h=figtext(textstart_x,textstart_y,'Level curves at:','norm'); 
080 set(h,'FontWeight','Bold') 
081  
082 textstart_y=textstart_y-delta_y; 
083  
084 for i=1:n_clevels 
085   textstart_y=textstart_y-delta_y; 
086   figtext(textstart_x,textstart_y,num2str(clevels(i)),'norm') 
087 end 
088  
089

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