About Using the MATLAB built-in function in fitting process

Hello, I'm using custom equations in fitting my data. The problem is that these equations contain one or more MATLAB built-in functions (e.g., expint, lambertw,..) and it takes so long (about 20 minutes) to converge. Is there any way so that I can decrease the accuracy of these built-in functions so that the convergence become faster? Or any idea to accelerate the fitting process?
Thanks.

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 12 月 20 日

0 投票

expint() is available both numerically and in the Symbolic Toolbox. lambertw is available only in the symbolic toolbox, but a numeric version of it is available in the File Exchange
If you need to use the symbolic toolbox then you can decrease computation time by setting Digits to lower.

7 件のコメント

Amr Sadek
Amr Sadek 2015 年 12 月 20 日
Thank you for your answer. I use these equations in a GUI. So I'm using the MATLAB (numeric version) not the Symbolic Toolbox.
Walter Roberson
Walter Roberson 2015 年 12 月 21 日
How were you calling a numeric lambertw ? Were you already using the version from the File Exchange?
Amr Sadek
Amr Sadek 2015 年 12 月 21 日
I'm using MATLAB 2014a. The Lambertw function is a built-in function. I don't use any File Exchange.
Walter Roberson
Walter Roberson 2015 年 12 月 21 日
Please use
which -all lambertw
to see which LambertW implementation you are getting. The two that are documented are Symbolic Toolbox, MATLAB Interface and Symbolic Toolbox, MuPAD Engine
There are a few different implementations in the File Exchange, including the one by Cleve, linked above, and another by D.A. Barry at http://www.mathworks.com/matlabcentral/fileexchange/3644-real-values-of-the-lambert-w-function
Amr Sadek
Amr Sadek 2015 年 12 月 21 日
I'm actually using lambertw(x) for the first (principal) branch and lambertw(-1,x) for the second branch in my codes. Is that what you mean?
Walter Roberson
Walter Roberson 2015 年 12 月 21 日
What does
which -all lambertw
say?
Amr Sadek
Amr Sadek 2015 年 12 月 21 日
which -all lambertw
D:\...\MATLAB 2014a\toolbox\symbolic\symbolic\@single\lambertw.m % single method
D:\...\MATLAB 2014a\toolbox\symbolic\symbolic\@double\lambertw.m % double method
D:\...\MATLAB 2014a\toolbox\symbolic\symbolic\@sym\lambertw.m % sym method

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeError Functions についてさらに検索

質問済み:

2015 年 12 月 20 日

コメント済み:

2015 年 12 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by