Hi,
the numerical integration command (quad) needs a function or an string as input (but I only have the values of the vector (e.g. 5 60 45 3 8 etc.)). I programmed Simpsons rule:
%int=1/3*h*[fo+4*(f1+f3+...+f2n-1)+2*(f2+f4+...+f2n-2)+f2n]
and the results seem quite reasonable (about 5% error...
Hi,
I'm using MATLAB 6.1 and want to calculate the area between the plot of a vector (with given values for the components) and the x-axis. I tried the quad command, but that's for functions only. Also the polyarea command doesn't seem to calculate the area correctly.
Can anyone tell me the, if...