simple question of creating a time vector

조회 수: 22 (최근 30일)
rami zaboura
rami zaboura 2020년 8월 7일
답변: Star Strider 2020년 8월 7일
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:)

채택된 답변

Star Strider
Star Strider 2020년 8월 7일
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.
.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by