Вы находитесь на странице: 1из 1

Generating Square and Sawtooth Waves

>>t=0:0.001:1;
>>x=square(2*pi*10*t);
>>subplot(2,1,1);plot(t,x,'LineWidth',2);grid;
>>axis([0 1 -1.2 1.2]);
>>title('Square-wave');
>>ylabel('Amplitude');
>>%y=max(0,x);
>>z=sawtooth(2*pi*10*t);
>>subplot(2,1,2);plot(t,z,'LineWidth',2);grid;
>>title('Sawtooth Wave')
>>ylabel('Amplitude')
>>xlabel('Time')
>>axis([0 1 -1.2 1.2])

Вам также может понравиться