Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (20 sloc) 473 Bytes
f = @(x) exp(-x^2);
dx_f = Ableiten(f);
dx2_f = Ableiten(dx_f);
format long
a = 0;
b = 0.5;
h = 0.1;
h^2 / 12 *(b-a) * max(abs(dx2_f(a)), abs(dx2_f(b)))
% returned die Ableitung der Funktion func
%
% [funcDiff] = ableiten(@(x) x.^5 - 5*x.^4 - 30*x.^3 + 110*x.^2 + 29*x - 105)
%
% func = Funktion, die abgeleitet werden soll
% funcDiff = abgeleteitete Funktion
%
function [funcDiff] = Ableiten(func)
syms y(x)
y(x) = func;
funcDiff = matlabFunction(diff(y,x));
end
You can’t perform that action at this time.