Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- close all
- clear all
- t=0:0.01:4*pi;
- w=1;
- A=4;
- y=A*cos(t).*(sin(2*w*t).^2);
- yw=y
- for i=2:length(t)-1;
- if y(i)>0
- yw(i)=y(i)^2;
- elseif y(i)<0;
- y(i)=y(i);
- end
- end
- plot(t,y,'r')
- xlabel('Amplitude')
- ylabel('time')
- grid on
- hold on
- plot(t,yw,'g')
- legend('legenda')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement