Home > NoiseTools > nt_3Dmat2cell.m

nt_3Dmat2cell

PURPOSE ^

[y]=3Dmat2cell(x) - convert 3D matrix to trial cell array

SYNOPSIS ^

function [y]=nt_3Dmat2cell(x)

DESCRIPTION ^

[y]=3Dmat2cell(x) - convert 3D matrix to trial cell array

  y: trial array (each trial is samples*trials)

  x: matrix (samples * channels * trials)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [y]=nt_3Dmat2cell(x) 
0002 %[y]=3Dmat2cell(x) - convert 3D matrix to trial cell array
0003 %
0004 %  y: trial array (each trial is samples*trials)
0005 %
0006 %  x: matrix (samples * channels * trials)
0007 
0008 if ~ndims(x)==3; error('!'); end
0009 
0010 [nsamples,nchans,ntrials]=size(x);
0011 y={};
0012 for k=1:ntrials
0013     y{k}=x(:,:,k);
0014 end

Generated on Sat 29-Apr-2023 17:15:46 by m2html © 2005