Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ~isempty by isfield #1

Open
Jasosahe01 opened this issue Apr 11, 2017 · 1 comment
Open

Change ~isempty by isfield #1

Jasosahe01 opened this issue Apr 11, 2017 · 1 comment

Comments

@Jasosahe01
Copy link

Hi!

I suggest you to change line 63 on STBLFIT.m
if ~isempty(opt.MaxIter)
by
if isfield(opt,'MaxIter')

and line 66
if ~isempty(opt.TolX)
by
if isfield(opt,'TolX')

Regards!

@markveillette
Copy link
Owner

Thanks for the feedback!

These should always be fields if opt is created with statset. However if you want to pass in your own struct then we would still need to handle the case where MaxIter or TolX are empty. How about this instead?

if isfield(opt,'MaxIter') && ~isempty(opt.MaxIter)
if isfield(opt,'TolX') && ~isempty(opt.TolX)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants