DEMOCC_MARKMAX plots load and marks a maximum CALL: k=democc_markmax(proc,tp,k,diff) Used by democc
A program for visualization of cycle counts in random | |
illustrates the definition of min-max cycles. | |
illustrates the definition of rainflow cycles. |
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
Comments or corrections to the WAFO group