EEG ~ Compare section of sample data with entire sample
Show older comments
I have having some trouble with my code. I am trying to take a small portion of my code and want to correlate it with the entire data. Trying to sweep the 25 data points I selected with the original 25 data points. I am getting an error message and I don't know how to sweep across all the data.
??? Error using ==> horzcat CAT arguments dimensions are not consistent.
Error in ==> EE127_PostLab4 at 153 R=[b,c];
My code is below.
for i=1:230
b=eeg2c3(i:230);
c=eeg2c3(95:120);
d=b(i:25);
R=xcorr (b,c);
b=b-25;
end
figure ('Name', 'Test', 'NumberTitle', 'off');
plot (R);
This is what it's plotting
Answers (1)
Walter Roberson
on 18 Apr 2012
0 votes
You would get that problem if eeg2c3 is a column vector. If you are expecting column vectors, use [b;c] instead of [b,c]
4 Comments
Frank
on 18 Apr 2012
Frank
on 18 Apr 2012
Walter Roberson
on 18 Apr 2012
I'm having to make some guesses about what you are doing.
c = eeg2c3(95:120);
for i=1:230-24
b = eeg2c3(i:i+24);
R(i) = xcorr(b,c);
end
plot(R);
Frank
on 18 Apr 2012
Categories
Find more on EEG/MEG/ECoG 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!