function ret = H(i,m)
%
% ret = H(i,m)
% 
% ret = H(0,m) returns m
% ret = H(i,m) returns the value of H at state i
%
persistent rumore;
if (i == 0)
  ret = m;
  rand('seed',m);
  rumore = (2*rand(1,m)-1)*5;
else
  x = linspace(pi/2,2*pi,m);
  ret = x(i).^2.*sin(5*x(i))+rumore(i);
end
