Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Passing parameters to a function used by fminsearch
Replies: 3   Last Post: Jul 30, 2013 12:45 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Ridvan Akkurt

Posts: 1
Registered: 1/21/08
Passing parameters to a function used by fminsearch
Posted: Jan 21, 2008 2:32 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I need to solve a non-linear equation:
x^n=(a/b) (1/(c+(d/x)))(1/e)

x is the unknown, all the others(a,b,c,d,n) are
parameters, and all scalars.

I wanted to use fminsearch to solve the problem:

x=fminsearch(myFunc,x0,options);

where

function[f]=myFunc(x)

f= (x^n)-(a/b) (1/(c+(d/x)))

The values of (a,b,c,d,n) change all the time, so I do
not want to hard wire their values into the function
definiton. How do I pass their values to myFunc, without
the use of globals?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.