Integration variable inside interpolation function

Hi all,
I wish to perform an integration as indicated below.
I am facing an error because the I am using the integration variable 'u' inside interpolation function. (If I replace 'u' inside interpolation function by some constant, the integration runs fine.)
>> syms u
>> double(int(2*interp1(x,y,u),u,0,0.1))
Error using interp1>Interp1D (line 330)
Inputs must be floats, namely single or double.
Error in interp1 (line 220)
Vq = Interp1D(X,V,Xq,method);
Can you please provide some pointers to fix it.
P.S.: For clarification, y=f(x) [piecewise function] which is why I am interpolating to determine intermediate values.
Thanks a lot !!

 Risposta accettata

Matt J
Matt J il 1 Dic 2013
Modificato: Matt J il 1 Dic 2013
Why do it by symbolic computation at all? Why not just use integral() or trapz()?

Più risposte (0)

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by