Trying to get the integral of some experimentally collected data.
After using the envelope and abs functions I'm using the fit function to get the equation I wish to integrate (unfortunately 'poly
' isn't giving a close enough fit to the data):
[yupper,ylower] = envelope(signal,1000,'peak');
dat = abs(yupper);
f = fit(x,dat,'linearinterp');
Then when I try
q = integral(f,3e4,9e4);
I get the error:
Error using integral (line 82) First input argument must be a function handle.
Error in findenergyfromfitcurve (line 10)
q = integral(f,3e4,9e4)
;
I thought f
was a (mathematical) function, don't understand what the error is telling me. When I try using 'poly3
' incase it's the linearinterp messing things up I still get that error.
TIA