필터 지우기
필터 지우기

less time to run how

조회 수: 1 (최근 30일)
SHARAD KUMAR UPADHYAY
SHARAD KUMAR UPADHYAY 2019년 2월 22일
댓글: SHARAD KUMAR UPADHYAY 2019년 2월 23일
%% 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.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by