f



Disabling warnings in nlinfit

Any knows how to disable the nlinfit warning when does not converge?
0
F.O.espina (14)
6/17/2004 9:12:32 AM
comp.soft-sys.matlab 211266 articles. 13 followers. lunamoonmoon (258) is leader. Post Follow

1 Replies
513 Views

Similar Articles

[PageSpeed] 49

> Any knows how to disable the nlinfit warning when does not converge?

I hope you know what you're doing, because I would want to see this warning.
Anyway, below I illustrate how to do it in R14.  I don't know if this would
work in an earlier release (I suspect the warning id was not available
then), but it would be possible to turn off all warnings in earlier
releases.

-- Tom

% Warning here
>> load census
>> g = @(p,x) p(1)+p(2)*x.^p(3)
g =
    @(p,x) p(1)+p(2)*x.^p(3)
>> b = nlinfit(cdate,pop,g,[0 1 1])
Warning: Iteration limit exceeded.  Returning results from final iteration.
> In nlinfit at 220
b =
  1.0e+003 *
   -1.9945    0.0005    0.0011

% No warning here
>> [wmsg,wid] = lastwarn
wmsg =
Iteration limit exceeded.  Returning results from final iteration.
wid =
stats:nlinfit:IterationLimitExceeded
>> warning('off',wid)
>> b = nlinfit(cdate,pop,g,[0 1 1])
b =
  1.0e+003 *
   -1.9945    0.0005    0.0011
>> warning('on',wid)


0
tom.lane (314)
6/17/2004 1:30:47 PM
Reply: