Hi,
I am very new to matlab... I have a 1D array of 45000 points they are sampled at 256Hz.
Now i want to plot the 1D array but on my x-axis i want to display the actual time, so 45000 * 1/256. How do i scale my x-axis?
Best regards, Thijs

 採用された回答

dpb
dpb 2016 年 10 月 24 日
編集済み: dpb 2016 年 10 月 24 日

0 投票

Simplest (at cost of some extra memory) is to just define a t vector to plot against...
t=linspace(0,(length(data)-1)/256,length(data)); % set start,stop times, compute interval
or
t=[0:1/256:(45000-1)/256]; % set start, dt, compute end time
NB: the "-1" on overall duration since there's one fewer dt intervals than number of elements in vector...

その他の回答 (0 件)

タグ

質問済み:

2016 年 10 月 24 日

編集済み:

dpb
2016 年 10 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by