simple question of creating a time vector

21 Ansichten (letzte 30 Tage)
rami zaboura
rami zaboura am 7 Aug. 2020
Beantwortet: Star Strider am 7 Aug. 2020
hello everyone,
i have a data set of 15345 samples, duration of 60 seconds, and sample frequency of 256 hz , how do i create the right time vector ?
i have tried to use : t=0:1/fs:1 and it wasnt correct, (fs being 256)
any suggetion would be helpful. thanks in advance:)

Akzeptierte Antwort

Star Strider
Star Strider am 7 Aug. 2020
Without the exact details of your file (that I suspect is not exactly 60 seconds long), something like this will work:
t = linspace(0, 60, 15345);
Note that this provides a sampling frequency of 255.73 Hz, so it may need to be tweaked a bit to get exactly the 256 Hz sampling frequency.
Calculating:
seconds = 15345/256
produces:
seconds =
59.9414
so you may want to check the actual duration.
.

Weitere Antworten (0)

Kategorien

Mehr zu EEG/MEG/ECoG finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by