Main Content


Resample Sobol indices or elementary effects to new time vector

Since R2020a



results = resample(gsaObj,timeVector) resamples model evaluations to a vector of new time points. By default, the function uses the interp1q interpolation method.


results = resample(gsaObj,timeVector,method) specifies the interpolation method.


collapse all

Load the lotka model.

m = sbmlimport("lotka");

Decompose the variance of predators y2 into attributions of the initial values of the prey y1 and predators.

sobolResults = sbiosobol(m,["y1","y2"],"y2","StopTime",1);

Resample the Sobol indices to a new time vector.

newSobolResults = resample(sobolResults,linspace(0,1,50));

Input Arguments

collapse all

Results from global sensitivity analysis, specified as a SimBiology.gsa.Sobol or SimBiology.gsa.ElementaryEffects object.

New time points, specified as a nonempty real numeric vector containing finite and increasing values.

If timeVector includes time points outside the time interval encompassed by the simulation data in sobolObj, resample performs extrapolation. The function issues a warning and throws an error if resampling fails due to extrapolation.

See the help for the MATLAB function corresponding to the interpolation method in use for information on how the function performs the extrapolation.

Data Types: double

Interpolation method, specified as a string or character vector. The valid options follows.

  • 'interp1q' — Use the interp1q function.

  • Use the interp1 function by specifying one of the following methods:

    • 'nearest'

    • 'linear'

    • 'spline'

    • 'pchip'

    • 'v5cubic'

  • 'zoh' — Specify the zero-order hold.

Data Types: char | string

Output Arguments

collapse all

Resampled simulation results computed at new time points, returned as a SimBiology.gsa.Sobol or SimBiology.gsa.ElementaryEffects object. If the input is a SimBiology.gsa.Sobol object, the returned results contain resampled simulation results and Sobol indices computed at new time points. If the input is an SimBiology.gsa.ElementaryEffects object, the results contain resampled simulation results and elementary effects computed at new time points.

Version History

Introduced in R2020a