function ode04_demo2
%
% Kinky plots
    
  % [t, x] = ode45(@test, [0 10*pi], 3, odeset('refine',1)); 
  ode45(@test, [0 10*pi], 3, odeset('refine',4)); 
  % plot(t, x, '+-', 'linewidth', 2), grid
  fprintf('Press <Enter> to continue\n')
  pause
  
  [t, x] = ode45('test', [0 10*pi], 3, odeset('refine',10));
  l = (length(t) - 1) / 10;
  tp = t(10*(0:l) + 1);
  xp = x(10*(0:l) + 1);
  plot(t,x, '-+', tp,xp,'o--', 'linewidth', 2), grid
end

function xpr = test(t, x)
  xpr = cos(t) / (2 * (x - 1));
end
