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 !!

 채택된 답변

Matt J
Matt J 2013년 12월 1일
편집: Matt J 2013년 12월 1일

0 개 추천

Why do it by symbolic computation at all? Why not just use integral() or trapz()?

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

제품

질문:

2013년 12월 1일

편집:

2013년 12월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by