Expanding array from seconds to samples
이전 댓글 표시
I have an array (these are seconds of EEG data) that I want to expand to samples, where Fs=128.
bad_seconds = [1 2 11 13 14 15 17 18 22 24 26 27 37 47 48 50 57 58 70 75 90 118 120 144 145 147]
So for example, I would want the first two elements of the array to expand by 128 and look like this
bad_samples = [1:256 1208:1408.....]
I tried something like the following, but it doesn't get me the range that I want, just the start and end values and I would ideally just insert a colon between every other value for the range of samples!
Fs = 128;
bad_samples_start = (bad_seconds * Fs)-128;
bad_samples_end = bad_samples_start + 128;
temp = [bad_samples_start; bad_samples_end];
combined = temp(:)';
Any help would be appreciated, thanks! Still learning my way around Matlab things.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!