Discrete Time Plotting in MATLAB

조회 수: 3 (최근 30일)
Meli
Meli 2020년 9월 6일
댓글: Meli 2020년 9월 6일
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?

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020년 9월 6일
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)])
  댓글 수: 1
Meli
Meli 2020년 9월 6일
Thank you! So if I use the commands, my plot ends up looking like this, which could proably be due to a lot of noise while I took the data, but is there any way for this to look cleaner or did I mix up the order of the codes?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by