Clear Filters
Clear Filters

Ask for plotting rectangular pulse with controlled width

1 view (last 30 days)
Hi; I would like to plot a series of rectangular pulse from a vector data input. The plot profile would create a rising edge of the pulse for a positive number and create the falling edge for the negative of that number. The plot should separate color for each represented number.
For example, if vector input X is [1 -1 2 -2 3 4 1 -4 -1 -3] Amplitude of data ‘1’ is 5, Amplitude of data ‘2’ is 4, Amplitude of data ‘3’ is 3 and Amplitude of data ‘4’ is 2
So, the input X got index from t(1) to t(10). The output of plot or chart should look like the inserted image.
How would I write a MATLAB code for this work?
Thank you. Bundit

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!