Home > wafo > wdemos > democc_markmax.m

# democc_markmax

## PURPOSE

plots load and marks a maximum

## SYNOPSIS

k=democc_markmax(proc,tp,k,diff)

## DESCRIPTION

``` DEMOCC_MARKMAX plots load and marks a maximum

CALL: k=democc_markmax(proc,tp,k,diff)

Used by democc```

## CROSS-REFERENCE INFORMATION

This function calls:
 axis Control axis scaling and appearance. hold Hold current graph. plot Linear plot.
This function is called by:
 democc A program for visualization of cycle counts in random democc_mmdef illustrates the definition of min-max cycles. democc_rfcdef illustrates the definition of rainflow cycles.

## SOURCE CODE

```001 function k=democc_markmax(proc,tp,k,diff)
002
003 %DEMOCC_MARKMAX plots load and marks a maximum
004 %
005 % CALL: k=democc_markmax(proc,tp,k,diff)
006 %
007 % Used by democc
008
009 % Tested on: matlab 5.3
010 % History:
011 % Revised by PJ 10-Jan-2000
012 %   updated for WAFO
013 % Original version by Mats Frendahl
014
015 ms = 20; % markersize
016
017 n=length(tp);
018 if k<1
019   k=1;
020 elseif k>n
021   k=n;
022 end
023
024 % Check if it is a maximum, otherwise find nearest maximum.
025 if k~=n
026   if tp(k+1,2)>tp(k,2)
027     k=k+1;
028   end
029 else
030   if tp(k-1,2)>tp(k)
031     k=k-1;
032   end
033 end
034
035 plot(proc(:,1),proc(:,2)), hold on
036 plot(tp(k,1),tp(k,2),'k.','markersize',ms)
037 hold off
038
039 axis([min(proc(:,1)) max(proc(:,1)) 1.1*min(proc(:,2)) 1.1*max(proc(:,2))])
040```

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