less time to run how

3 ビュー (過去 30 日間)
SHARAD KUMAR UPADHYAY
SHARAD KUMAR UPADHYAY 2019 年 2 月 22 日
%% i am using this and it take long time to run,
F_half=integral(fun,0,inf,'ArrayValued',true,'RelTol',1e-4)
%% if i use this F_half=integral(fun,0,inf) then it take less time
%% as i am using this F_half=integral(fun,0,inf,'ArrayValued',true,'RelTol',1e-4) type function many times and that take too much time why and how can i colve it
%% and what is the use of 'ArrayValued',true,'RelTol',1e-4

回答 (1 件)

Torsten
Torsten 2019 年 2 月 22 日
編集済み: Torsten 2019 年 2 月 22 日
Usually, fun is called for a vector of x-values and must return an array of the same size. ArrayValued = true forces "integral" to evaluate your function only for one single x-value at a time. This causes longer run times.
  1 件のコメント
SHARAD KUMAR UPADHYAY
SHARAD KUMAR UPADHYAY 2019 年 2 月 23 日
ok

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

カテゴリ

Help Center および File ExchangeNaNs についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by