Will the ArrayValued option for integral improve or diminish performance relative to looping when integrating a vector-valued function?

I want to integrate K different scalar-valued functions over the same range (from 0 to 1).
Option A) is to loop from k=1:1:K, and call integral on each function with ArrayValued=False (the default).
Option B) is to create a cell-array of the K functions and call integral once with ArrayValued=True.
From my reading (in particular this answer: http://www.mathworks.com/matlabcentral/answers/147338-integrate-function-that-calls-a-function) it would seem that performing Option A) with ArrayValued=True is going to be slower than Option A) with ArrayValued=False, since ArrayValue=True will turn off vectorization for univariate integrals. This makes sense to me.
However, what about Option B) vs. Option A)? Will Option B) also be slower?

Risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange

Richiesto:

il 17 Giu 2016

Community Treasure Hunt

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

Start Hunting!

Translated by