MATLAB Simpson's 1/3 Rule and Romberg
问题 I'm just starting to learn MATLAB. The purpose of the exercise is to approximate/integrate using Simpson's 1/3 rule and romberg. The problem is to integrate x^(1/2) from 0 to 2 When I execute: simpson(fun,0,2,10) I get an error on line 2: fun = x^(1/2); or on line 16 of simpson: f = feval(fun,x); Thanks for the help! Here is my equation code: function [fun] = ff(x) fun = x^(1/2); end My simpson code: function I = simpson(fun,a,b,npanel) % Multiple Segment Simpson's rule % % Synopsis: I =