Asked by Sarah CHOUCHENE
on 17 Nov 2019 at 10:17

Hello,

I really need to clear up my toughts, I want to extract a fonction from a table of two dimensions ( l,t) that I recover from and ODE method.

[t,l]=ode23('odef',[t0,tf],l0)

My goal is to integrate "l" Si I need to have a function to use for exemple the simpson method :

f = inline('l','t')

h = 100/N;

Isim=0.0;

for i=1:N

Isim= Isim+h*(1/6*f(t(i))+2/3*f((t(i)+t(i+1))/2)+1/6*f(t(i+1)));

end

Isim

Of corse this program doesn't work because I used a vecto as a function !

Do you have an idea how can I integrate from data ?

Thank you,

Regards,

Opportunities for recent engineering grads.

Apply Today
## 14 Comments

## Walter Roberson (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_768177

## Sarah CHOUCHENE (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_768200

## Walter Roberson (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_768239

## Sarah CHOUCHENE (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_768271

## Walter Roberson (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_768277

## Sarah CHOUCHENE (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_768432

## Walter Roberson (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_768680

## Sarah CHOUCHENE (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_769235

## Walter Roberson (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_769239

## Sarah CHOUCHENE (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_769244

## Sarah CHOUCHENE (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_769248

## Sarah CHOUCHENE (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_769259

## Walter Roberson (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_769406

## Sarah CHOUCHENE (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/491533-extract-a-function-from-a-table#comment_769479

Sign in to comment.