How to combine array elements to form a single signal

I am trying to create a PWM signal based on dynamic inputs of Duty cycle.
For that, I have creted an array of On and Off timing using a Steteflow. So if my Duty Cycle is 30%, PulseArray = [1110000000].
Now I need a single signal which is a PWM pulse, with this ON-OFF time. How do I combine all these array elements to form one signal ?
Thanks in advance!

2 Comments

In the above case of 1110000000 what would value of the single signal be?
Please refer to the attached figure. Case "C" is what I want from the pulse - 1110000000. i.e. ON for 3 parts of sample time, then OFF for 7 parts of sample time.
Similarly, based on the input duty cycle, I want to create a PWM waveform.
If input duty cycle is 50% (Case "A"), my output should be a waveform, which is ON for 5 parts and OFF for 5 parts of my sample time.
Based on Duty cycle, I can now create this array, but I need to now convert this array into a waveform.

Sign in to comment.

Answers (0)

Asked:

on 28 Nov 2019

Commented:

on 28 Nov 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!