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: fminsearch and functions
Replies: 3   Last Post: Feb 1, 2013 5:24 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Robert Ahrens

Posts: 5
Registered: 9/30/10
fminsearch and functions
Posted: Jan 31, 2013 11:57 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I should preface this post by saying that I have never used fminsearch for multivariable functions and I am not a heavy user of anonymous functions.

I have defined a function myfun2:

function f = myfun2(x,y,xc,yc)

n = length(x)
f = sqrt((sum((sqrt((xc - x).^2 + (yc - y).^2) - ...
sum(sqrt((xc - x).^2 + (yc - y).^2)/n)).^2)/n))
end

where x and y are vectors (of length upwards of 10,000) and xc and yc are scalars. Basically, I have known x and y vectors and I want to find xc and yc such that f is minimized. I've read through the fminsearch documentation and posts on the Matlab newgroups and I have not been able to find any information as to how to do so.

Any and all help is appreciated.
Bob



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.