Home > bioelectromagnetism > source_dipole_script.m

source_dipole_script

PURPOSE ^

source dipole script

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 source dipole script

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 
0003 % source dipole script
0004 
0005 eegPath = eeg_toolbox_path;
0006 cd(eegPath)
0007 
0008 LMAX = 250;
0009 
0010 if exist('source_dipole.mat') == 2,
0011   load source_dipole
0012 else
0013   Cdata = cell(LMAX,1);
0014   for L = 1:LMAX,
0015     FV = source_dipole_sphere([],[],L);
0016     Cdata(L) = FV.Cdata;
0017   end
0018   FV.Cdata = Cdata; clear Cdata;
0019   save source_dipole FV;
0020 end
0021 
0022 Nvertices = 6;
0023 vertices = round(rand(Nvertices,1) * 1000);
0024 vertex_potentials = zeros(Nvertices,LMAX);
0025 
0026 for Lmax = 1:LMAX,
0027   
0028   vertex_potentials(:,Lmax) = FV.Cdata{Lmax}(vertices);
0029   
0030   if LMAX < 15,
0031     figure;
0032     patch('vertices',FV.vertices,'faces',FV.faces,'FaceVertexCData',FV.Cdata{Lmax},'Facecolor','interp');
0033     colorbar; view([-40,35])
0034   end
0035 end
0036 
0037 LPLOT = 1:20;
0038 
0039 COLS = 3;
0040 ROWS = ceil(Nvertices / COLS);
0041 
0042 figure
0043 PLOT = 0;
0044 for v = 1:Nvertices,
0045   PLOT = PLOT + 1;
0046   subplot(ROWS,COLS,PLOT);
0047   plot(LPLOT,vertex_potentials(v,LPLOT))
0048   hold on
0049   scatter(LPLOT,vertex_potentials(v,LPLOT))
0050 end

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