Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- close all;
- clear all;
- A=230;
- fs=100;
- t=1;
- counter=1;
- number=1;
- for f=0:5:300
- w=2*pi*f;
- for i=0:1/fs:t
- x(counter)=i;
- y(counter)=sin(w*i);
- %y(licznik)=cos(w*i);
- counter=counter+1;
- end
- Title=['petla nr ' int2str(number) ', ' 'f = ' int2str(f)];
- hold on
- plot(x,A*y)
- xlabel('second')
- ylabel('Volt')
- title(Title);
- counter=1;
- number=number+1;
- pause(1);
- end
- f1=5;
- f2=105;
- f3=205;
- counter=1;
- for i=0:1/fs:t
- x1(counter)=i;
- y1(counter)=sin(2*pi*f1*i);
- %y1(counter)=cos(2*pi*f1*i);
- x2(counter)=i;
- y2(counter)=sin(2*pi*f2*i);
- %y2(counter)=cos(2*pi*f2*i);
- x3(counter)=i;
- y3(counter)=sin(2*pi*f3*i);
- %y3(counter)=cos(2*pi*f3*i);
- counter=counter+1;
- end
- figure
- hold on
- plot(x1,A*y1,'b-')
- xlabel('second')
- ylabel('Volt')
- plot(x2,A*y2,'r-o')
- plot(x3,A*y3,'k-x')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement