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
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 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by