Home > bioelectromagnetism > eeg_diff_script.m

eeg_diff_script

PURPOSE ^

eeg_diff_script - calculate ERP difference waves

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 eeg_diff_script - calculate ERP difference waves
 Author: Darren.Weber_at_radiology.ucsf.edu

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % eeg_diff_script - calculate ERP difference waves
0002 % Author: Darren.Weber_at_radiology.ucsf.edu
0003 
0004 path = 'd:\MyDocuments\emse_data\ptsd-pet\link14hz\';
0005 % path = '/floyd3/psdlw/ptsd-pet/original-scan/';
0006 
0007 infile_ext = '_link14hz.txt';
0008 outfile_ext = 'sa_dif_link14hz.txt';
0009 
0010 format = '%12.4f ';
0011 
0012 
0013 groups = {'c' 'p'};
0014 subjects = {'01' '02' '03' '04' '05' '06' '07' '08' '09' '10'};
0015 conditions = {'oac' 'ouc'}; % 'out' 't' 'tac' 'tad' 'tat' 'tuc' 'tud' 'tut'};
0016 
0017 for g = 1:length(groups)
0018     for s = 1:length(subjects)
0019         subj = strcat(char(groups(g)),char(subjects(s)));
0020         
0021         % load input data
0022         infile1 = strcat(path,subj,conditions(1),infile_ext);
0023         infile2 = strcat(path,subj,conditions(2),infile_ext);
0024         
0025         data1 = eeg_ascii_load(infile1);
0026         data2 = eeg_ascii_load(infile2);
0027             
0028         % calculate difference
0029         dif = data1 - data2;
0030             
0031         % output difference data
0032         outfile = strcat(path,subj,outfile_ext);
0033         eeg_ascii_write(outfile,dif,format);
0034         
0035         %return
0036 
0037     end
0038 end

Generated on Mon 15-Aug-2005 15:36:19 by m2html © 2003