How can I plot a square wave in Matlab
3 views (last 30 days)
Show older comments
Mallouli Marwa on 30 Nov 2018
Answered: Star Strider on 30 Nov 2018
As attached the square wave equation.
How can I plot it ?
Star Strider on 30 Nov 2018
f = 5; % Frequency
N = 16; % Order Of Harmonics
t = linspace(0, 4, 500); % Time Vector
sqwv = @(f,t,n) 4*sum(bsxfun(@rdivide, sin(2*pi*(1:2:N)'*t), (1:2:N)'))/pi;
More Answers (0)
Find more on Get Started with MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!