Path: news.mathworks.com!not-for-mail
From: "David Doria" <daviddoria@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Minimize a c++ function with matlab
Date: Thu, 13 Mar 2008 12:04:13 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <frb57t$di7$1@fred.mathworks.com>
Reply-To: "David Doria" <daviddoria@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1205409853 13895 172.30.248.37 (13 Mar 2008 12:04:13 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 13 Mar 2008 12:04:13 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1105197
Xref: news.mathworks.com comp.soft-sys.matlab:456993



Recently I've been looking into the matlab engine for
calling matlab from c++. I would like to utilize fminunc()
from a c++ program.  Say I have a c++ function:

int MyFunc(int Param)
{
  return pow(Param,2);
}

Is there anyway to pass this function to fminunc()?? Seems
like a reasonable thing to want to do, but from what I know
about the engine I have no idea how to approach it.

Any tips would be great!

Thanks,

David