Home > eeg > egis > egis_file_utils > remove_tspecs_v.m

remove_tspecs_v

PURPOSE ^

function outchdr = remove_tspecs_v(chdr,cell,trial)

SYNOPSIS ^

function outchdr = remove_tspecs_v(chdr,cell,trial)

DESCRIPTION ^

function outchdr = remove_tspecs_v(chdr,cell,trial)

Returns a matrix which is all the EGIS trial-specifics from chdr
minus the information from cell and trial. NTrials is decremented
as well. Intended for use with the matrices returned by rd_egis_hdr_v.

See Also:rd_egis_hdr_v, get_tspecs_v, put_tspecs_v, append_tspecs_v.

Created 5/8/95 by Brian Rakitin

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function outchdr = remove_tspecs_v(chdr,cell,trial)
0002 %function outchdr = remove_tspecs_v(chdr,cell,trial)
0003 %
0004 %Returns a matrix which is all the EGIS trial-specifics from chdr
0005 %minus the information from cell and trial. NTrials is decremented
0006 %as well. Intended for use with the matrices returned by rd_egis_hdr_v.
0007 %
0008 %See Also:rd_egis_hdr_v, get_tspecs_v, put_tspecs_v, append_tspecs_v.
0009 %
0010 %Created 5/8/95 by Brian Rakitin
0011 %
0012 
0013 %Call the script that defines the EGIS header constants
0014 ses_hdr_offsets_v;
0015 
0016 if ~(nargin==3 & nargout==1)
0017     error('Function get_tspecs_v requires 3 input and 1 output arguments.');
0018 end
0019 
0020 if cell > size(chdr,1)
0021     error(['Cell argument must be no greater than ' int2str(size(chdr,1))]);
0022 end
0023 
0024 if trial > chdr(cell,NTrials)
0025     error(['Trial argument must be no greater than ' int2str(chdr(cell,NTrials))]);
0026 end
0027 
0028 outchdr=zeros(size(chdr));
0029 outchdr=chdr;
0030 numspecs=floor(chdr(cell,LSpec)/2);
0031 tspec_offset = 6+((trial-1)*numspecs); 
0032 mask=ones(1,size(chdr,2));
0033 mask(tspec_offset:(tspec_offset+numspecs-1))=zeros(1,size([tspec_offset:(tspec_offset+numspecs-1)],2));
0034 outchdr(cell,1:size(outchdr,2))=zeros(1,size(outchdr,2));
0035 outchdr(cell,1:size(find(mask),2))=chdr(cell,mask);
0036 outchdr(cell,NTrials)=chdr(cell,NTrials)-1;

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003