square wave with different duty cycle???
10 次查看(过去 30 天)
显示 更早的评论
i want to draw square wave with different duty cycle???
thank you for your consideration.....
0 个评论
回答(1 个)
KALYAN ACHARJYA
2019-9-24
编辑:KALYAN ACHARJYA
2019-9-24
t=linspace(0,3*pi)';
duty_cycle=60; % Percentage
x = square(t,duty_cycle);
plot(t/pi,x)
grid on
Documentation here
More plots
for i=1:10
t=linspace(0,3*pi)';
duty_cycle=randi(100); % Percentage
x = square(t,duty_cycle);
plot(t/pi,x,'*-');
hold on;
end
grid on;
2 个评论
Walter Roberson
2019-10-1
Create a segment with one duty cycle, create a segment with a different duty cycle, concatenate the two with with the [] list operator.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!