Home > bioelectromagnetism > elec_distance_testscript.m

elec_distance_testscript

PURPOSE ^

elec_distance_testscript - test electrode distance calculations

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 elec_distance_testscript - test electrode distance calculations

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % elec_distance_testscript - test electrode distance calculations
0002 
0003 
0004 % Create 2 points a & b in Cartesian 3space
0005 elec_labels = cellstr(['a' 'b']');
0006 x = [ 2 -2]';
0007 y = [ 3  2]';
0008 z = [ 2  0]';
0009 
0010 xd = x(1) - x(2); yd = y(1) - y(2); zd = z(1) - z(2);
0011 dist = sqrt ( xd^2 + yd^2 + zd^2 );
0012 fprintf('Cartesian distance = %6.4f\n', dist);
0013 
0014 [labels, dist] = elec_distance(elec_labels,x,y,z);
0015 fprintf('Spherical arc length = %6.4f\n', dist(2,1));

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