Home > eeg > egis > spline > k_and_e.m

k_and_e

PURPOSE ^

SYNOPSIS ^

function [k,kinv,a,ainv,e]= k_and_e(w,x,y,z)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [k,kinv,a,ainv,e]= k_and_e(w,x,y,z)
0002 
0003 n = size(x,2);
0004 mm = 10;
0005 for i=1:n
0006     if x(i) == 0
0007         x(i) = 0.001;
0008     end;
0009     if y(i) == 0
0010         y(i) = 0.001;
0011     end;
0012     if z(i) == 0
0013         z(i) = 0.001;
0014     end;
0015 end;
0016 
0017 for i=1:n
0018     for j=1:n
0019         s = x(i) - x(j);
0020         t = y(i) - y(j);
0021         r = z(i) - z(j);
0022         str = s.^2 + t.^2 + r.^2;
0023         k(i,j) = ((str+ w).^2)*log(str+w);
0024     end;
0025 end;
0026 
0027 for i=1:n
0028 e(i,1) = 1;
0029 e(i,2) = x(i);
0030 e(i,3) = y(i);
0031 e(i,4) = x(i).^2;
0032 e(i,5) = x(i)*y(i);
0033 e(i,6) = y(i).^2;
0034 e(i,7) = z(i);
0035 e(i,8) = z(i)*x(i);
0036 e(i,9) = z(i)*y(i);
0037 e(i,10) = z(i).^2;
0038 end;
0039 kinv = inv(k);
0040 
0041 ke = kinv*e;
0042 
0043 et = e';
0044 
0045 a = et*ke;
0046 
0047 ainv = inv(a);
0048

Generated on Sun 24-Mar-2019 04:00:51 by m2html © 2003