square wave with different duty cycle???
Afficher commentaires plus anciens
i want to draw square wave with different duty cycle???
thank you for your consideration.....
Réponses (1)
KALYAN ACHARJYA
le 24 Sep 2019
Modifié(e) : KALYAN ACHARJYA
le 24 Sep 2019
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 commentaires
Muhammad Salman Bashir
le 1 Oct 2019
Walter Roberson
le 1 Oct 2019
Create a segment with one duty cycle, create a segment with a different duty cycle, concatenate the two with with the [] list operator.
Catégories
En savoir plus sur Simscape Electrical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!