Home > chronux > spectral_analysis > pointtimes > padNaN.m

padNaN

PURPOSE ^

Creates a padded data matrix from input structural array of spike times

SYNOPSIS ^

function data=padNaN(data)

DESCRIPTION ^

 Creates a padded data matrix from input structural array of spike times
 pads with NaN
 Usage: data=padNaN(data)
 Input:
 data : structural array of spike times
 Output:
 data : data matrix (zero padded)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function data=padNaN(data)
0002 % Creates a padded data matrix from input structural array of spike times
0003 % pads with NaN
0004 % Usage: data=padNaN(data)
0005 % Input:
0006 % data : structural array of spike times
0007 % Output:
0008 % data : data matrix (zero padded)
0009 NC=length(data); 
0010 fnames=fieldnames(data);
0011 for c=1:NC;
0012    eval(['Nsp(c)=length(data(c).' fnames{1} ');']);
0013 end;
0014 dtmp(1:max(Nsp),1:NC)=NaN;
0015 for c=1:NC;
0016     eval(['f=data(c).' fnames{1} ';'])
0017     dtmp(1:Nsp(c),c)=f;
0018 end;
0019 data=dtmp;

Generated on Fri 28-Sep-2012 12:34:30 by m2html © 2005