function Y = rbfpredict(NetParams,X) % Inputs: NetParams from rbfOLS % X is dim x numpts % Output: Y is out dim x numpts C=NetParams.C; %Centers for the RBF W=NetParams.W; %Weights b=NetParams.b; % bias spr=NetParams.spr; %Spread (actually, the reciprocal of spread) A=radbas1(dist(X',C')*spr); Y=A*W+b; Y=Y'; end %====================================================== function a = radbas1(n) a = exp(-(n.*n)); end %====================================================== function z=dist(w,p) % To be consistent with Matlab's dist function, the first % matrix is transposed with what it ought to be. % Incoming is numpts x dim and dim x numpts p=p'; %This should convert "dist" to "edm" input % EDM starts here; w and p should both be numpts x dim at this point [S,R] = size(w); [Q,R2] = size(p); p=p'; if (R ~= R2), error('Inner matrix dimensions do not match.\n'), end z = zeros(S,Q); if (Q