Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all
- close all
- t=0:0.02:6*pi;
- w=1;
- A=5;
- i_r=[];
- i_m=[];
- B=3;
- y=A*((sin(w*t).^3).*sin(2*w*t).^2).*exp(-B);
- yw=y;
- for i=2:length(t)-1;
- if yw(i)>y(i+1)&yw(i)>y(i-1);
- i_r=[i_r i];
- elseif yw(i)<y(i+1)&yw(i)<y(i-1);
- i_m=[i_m i];
- else
- end
- end
- plot(t(i_r),yw(i_r),'om')
- ylabel('Amplitude')
- xlabel('t')
- grid on
- hold on
- plot(t(i_m),yw(i_m),'<g')
- plot(t,yw,'r')
- legend({'y_m_a_x','y_m_i_n','y'})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement