Discrete Time Plotting in MATLAB
3 views (last 30 days)
Show older comments
So I'm trying to plot pulse data and my discrete time looks like a mess. I need the time interval to be between pulse n and n-1. I get what is supposed to be a discrete graph but it doesnt look okay to me. The discrete will plot like this...
Can someone explain what's wrong with my code please?


0 Comments
Answers (1)
Sulaymon Eshkabilov
on 6 Sep 2020
Hi,
Use this command:
stem(data_of_interest) % instead of stem(time, data_of_interest)
Your used command is plotting two data series, viz. time and data_of_interest
You may also need to use xlim command to have better view of your plotted data.
xlim([min(data_of_interest), max(data_of_interest)])
See Also
Categories
Find more on 2-D and 3-D Plots 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!