Error propagation through a function

Calculates the error propagation through a function NEEDS : Symbolic Math Toolbox
34 Downloads
Aktualisiert 28. Okt 2022

Lizenz anzeigen

The function takes 4 entries :
1) The function f written with symbolic variables
2) A 1*n matrix of the symbolic variables of the function
3) A 1*n matrix of the values of the variables to evaluate the function at (IMPORTANT : must be in the same order as the variables in 2))
4) A 1*n matrix of the values of the errors of the variables at the point given in 3) (IMPORTANT : must be in the same order as the variables in 2))
It then returns a 1*3 matrix containing the value of the function at this point in the first cell, the absolute error in the second cell and the relative error in the third one (in percentage!!)
See an example below :
syms A B C % We define the symbolic variables
f = 3*A*exp(B-C^2); % We define the function we are looking to propagate the error through
varlist = [A B C]; % The list of variables
vals = [2 4 0.1]; % The list of the values of the variables to evaluate the function at
errs = [0.2 0.1 0.001]; % The errors of the variables at this point
F_and_errors = propagErreur(f, varlist, vals, errs); % Calls the function to evaluate the function at the given point and propagate the error

Zitieren als

Adam Avedissian (2026). Error propagation through a function (https://de.mathworks.com/matlabcentral/fileexchange/119653-error-propagation-through-a-function), MATLAB Central File Exchange. Abgerufen.

Kompatibilität der MATLAB-Version
Erstellt mit R2022a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Tags Tags hinzufügen
Version Veröffentlicht Versionshinweise
1.01

Changed slight error in the description

1.0