newtonzao

mail@pastecode.io avatar
unknown
matlab
2 years ago
289 B
3
Indexable

function newtonStuff(h)
hDouble = str2double(h);
syms x f(x)
f(x) = cos((3*x^2) + 5*x);
fplot(f)
z=hDouble;

while z <= 13/10
    fplot(diff(f,x,2))
    syms m n(m)
    n(m) = (f(m+4*hDouble)- 2*f(m) + f(m-4*hDouble))/(16*hDouble^2);
    fplot(n)
    z=z+hDouble;
end
end