Cell array for indexing

Hello
I want to store 38 channels EEG data in a cell array
my code is working with one channel only hoe can i save my 38 cahnnels data in 38 rows of cells array
a=data.signal(:,:); a=a'; % 38 channels EEG signals
x=1;
y=3;
for k=1:1:(length(new_positions)/3)
new_signal{k}=a(new_positions(x):new_positions(y),1) % new_position is indexing matrix
x=x+3;
y=y+3;
end
its only returing 86x1 cell array instead i need 86x38 cell array

 Risposta accettata

Mathieu NOE
Mathieu NOE il 30 Giu 2021
hello
your assigning a vector to new_signal{k}
so I believe your intention was :
new_signal{k}=a(new_positions(x):new_positions(y),:) % new_position is indexing matrix
% and not
% new_signal{k}=a(new_positions(x):new_positions(y),1) % new_position is indexing matrix

4 Commenti

hajrah Sultan
hajrah Sultan il 1 Lug 2021
but still its not moving to the next EEG channel data after doing indexing of 1st channel it stops and gives error
Index exceeds the number of array elements
Mathieu NOE
Mathieu NOE il 1 Lug 2021
Could you share some data so I can better test the code ?
hajrah Sultan
hajrah Sultan il 1 Lug 2021
its a 7975145x38 matrix after testing 7975145 samples from 1st channel my code need to move to next channel but its not moving to next channel instead it is giving error about dimentions of arry
can you plewase guid me how my code with acces data of all remaning channels
new_signal{k}=a(new_positions(x):new_positions(y),:)
i am passing signal from this condition
here
new_signal is supossed to b 86x38 dimentional cell matrix
a is my raw data of 38 channels 7975145x38
new_position contaions the sapmle no from where it need to pick up sample.
Mathieu NOE
Mathieu NOE il 1 Lug 2021
can you show was is exactly the error message ??

Accedi per commentare.

Più risposte (0)

Prodotti

Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by