Path: news.mathworks.com!not-for-mail
From: "Toan Cao" <toancv3010@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: computation time of function lsqnonlin
Date: Fri, 13 Sep 2013 03:38:06 +0000 (UTC)
Organization: &#50872;&#49328;&#45824;&#54617;&#44368;
Lines: 8
Message-ID: <l0u1au$ei4$1@newscl01ah.mathworks.com>
Reply-To: "Toan Cao" <toancv3010@gmail.com>
NNTP-Posting-Host: rubyext-05-ls.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1379043486 14916 172.20.102.181 (13 Sep 2013 03:38:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 13 Sep 2013 03:38:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2244433
Xref: news.mathworks.com comp.soft-sys.matlab:802337

Hi,
I write an objective function in both m-file (fileA1.m) and C mex file (fileA2.c). Given an input to this objective function, computation time in C mex file is 15 times faster than that of m- file.  However, when i use the objective function in function lsqnonlin of Matlab, computation time which lsqnonlin gets a optimal solution is almost the same for both files (~101 minutes for C mex file and ~104 minutes for m-file).
I hope when i use C mex file, i will save more time for optimization process, but it is not.
Can you help me explain why  lsqnonlin spends almost the same computation time?
I would like to understand more how lsqnonlin of Matlab works to reduce its time?
Thanks in advance!

Toan