lfmarg.m 439 B

1234567891011121314151617
  1. function xfit = lfmarg(fit)
  2. % computes grid margins from a locfit object, used for plotting.
  3. % this function is called from lfplot and lfband, will not normally
  4. % be called directly by users.
  5. box = fit.fit_points.fit_limits;
  6. d = size(box,1);
  7. xfit = cell(1,d);
  8. mg = 10*ones(1,d);
  9. if (d==1) mg = 200; end;
  10. if (d==2) mg = [51 50]; end;
  11. for i=1:d
  12. xfit{i} = box(i,1) + (box(i,2)-box(i,1))*(0:mg(i))'/mg(i);
  13. end;
  14. return;