I am trying to obtain the integral function of a complicated relation.
Here though, to check out the code, I am implementing the integral of f(x) = x.
However, I get an error when the index i of my function reaches 0.7.
Could please tell me why?
Have a good day.
x = [0:0.1:1];
prova = @(x) x;
res(1:end) = fun_integra(prova, 0, 1, 0.1);
function [res] = fun_integra(integrand, low, up, step)
res((i-low)/(step)+1) = integral(integrand, low, i+step);