We have moved to @ Placement Papers Hub !! Visit our new website here for more..

MATLAB:GENERATING THE SQUARE WAVE FROM SINE WAVE




MATLAB: CODE FOR GENERATING THE SQUARE WAVE FROM SINE WAVE

clc;

clear all;

close all;

t=0:.01:4*pi;
y=5*sin(t);
figure(1);
plot(y);
for i=1:1200
    ify(i)>0
        s(i)=+5;
    else
        s(i)=-5;
    end
end
figure(2);
plot(s);