use fminsearch and fzero together

6 views (last 30 days)
hello, How to use fminsearch and fzero together, i mean i wanna minimize obj.func but there are some variables that need fsolve first. can it combine? thanks

Accepted Answer

Walter Roberson
Walter Roberson on 28 Feb 2017
Yes. The handle you provide to fminsearch can be to a complete function definition that takes whatever computation it needs to determine the value associated with the inputs.
  3 Comments
Stephen23
Stephen23 on 28 Feb 2017
@ni made veriska: DO NOT name any function or Mfile min: this will cause shadowing of the inbuilt min function, and prevent that very important function from working.
Walter Roberson
Walter Roberson on 28 Feb 2017
Your code shows calling trialp and shows the definition of optp but there is no definition for trialp and no call to optp or the "min" that you show as your first file

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!