Professional Documents
Culture Documents
Generation of Analog and Discrete Squarewave
Generation of Analog and Discrete Squarewave
clc
clear all
close all
f = 100;
T = 1/f;
t = 0:T/f:T;
x = square(2*pi*f*t);
subplot(2,1,1)
plot(t,x,'r')
grid
xlabel('Time - t')
ylabel('amplitude')
title('squarewave - 21075A1008')
% axis([0 T*1 1])
subplot(2,1,2)
stem(t,x,'y')
grid
xlabel('Time - t')
ylabel('amplitude')
title('discrete squarewave - 21075A1008')
% axis([0 T*1 1])
1
Published with MATLAB® R2020a