%
%  evaluate 1D radial basis function net
%
%   yhat = rbfnet( u, cc )
%
%  yhat  = approximated output data
%  cc    = net parameters = [ c tk sigma ]
%  c     = rbf coefficients
%  tk    = rbf centres
%  sigma = rbf widths
%  u     = input data
%
function yhat = rbfnet( u, cc )
%
% construct regression matrix
n = length( u );
[ k, m ] = size( cc );
c = cc(:,1);
tk = cc(:,2);
sigma = cc(:,3);
%
for i = 1:n,
  for j = 1:k,
    a(i,j) = exp( -((u(i)-tk(j))./sigma(j)).^2 );
  end;
end;
%
% calculate approximation
yhat = a * c;
%
