Error while storing matrix in a cell

Dear All,
I have written a program to extract components from my data (stored in matrix IMF) using an algorithm and stores these components in a cell array (imfcomponents). I am facing the following error in my program:
??? Conversion to cell from double is not possible.
Error in ==> extractingimf at 14 imfcomponents(epoch,1)=IMF;
Below is my program:
tic; % sub20imfcomp=zeros(41400,3); % imfsizesub20=zeros(23,3); imfcomponents=cell(1799,1); for epoch=1:1:1800 for channel=1:23
e1=e(:,:,epoch);
X=e1(:,channel);
IMF=emd(X);
%below is the line in which the error has occurred
imfcomponents(epoch,1)=IMF;
% [m,n]=size(IMF);
% imfsizesub13(channel,1)=m; % imfsizesub13(channel,2)=channel; % imfsizesub13(channel,3)=epoch; end % index=epoch-1; % sub13imfcomp(((index*23+1):(epoch*23)),:)=imfsizesub13; end save('IMF Components_Subject 20.mat','imfcomponents'); imfextracttime=toc;
Kindly guide me as to how I can overcome this error, thank you.

 采纳的回答

Just do:
imfcomponents{epoch} =IMF;
For example:
imfcomponents = cell(1799,1);
IMF = randn(1000,5);
epoch = 1;
imfcomponents{epoch} = x;

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by