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

 Risposta accettata

dpb
dpb il 24 Ott 2016
Modificato: dpb il 24 Ott 2016

0 voti

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...

Più risposte (0)

Richiesto:

il 24 Ott 2016

Modificato:

dpb
il 24 Ott 2016

Community Treasure Hunt

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

Start Hunting!

Translated by