simpson(@(x) 1./(1+x.^4),0,1,4)Hey guys.
I have the following matlab code
function y = simpson(f,a,b,n)
%SIMPSON Simpson's rule integration with equally spaced points
% y=SIMPSON(f,a,b,n) returns the Simpson's rule approximation to
% the integral of f(x) over the interval [a,b] using n+1 equally
% spaced points. The input variable f is a string containing the
% name of a function of one variable. The function f(x) must accept
% a vector argument and return the vector of values of the function.
% NOTE: n must be even.
It's the Simpson's rule in matlab.
I want to run the following code with the function y = 1/(1+x^4), how can I do it from the command line?