Expanding array from seconds to samples
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!