- #1

- 763

- 0

## Homework Statement

If i have an interpolation formula, say:

[tex]y(t_i)=3+h\sum^i_{j=1}jy(t_j)[/tex]

where i=0 to n

h=(a+b)/n

t

_{i}=i*h

and

when i=0, we have: y(t

_{0})=0.

How would i write a code to find y(t

_{i})?

## Homework Equations

## The Attempt at a Solution

function y=examp(a,b,n)

h=(a+b)/n

for i=1:n+1

t(i)=(i-1)*h

for j=1:i+1

and now im stuck because i dont know how write a code that uses the previous value of y to compute the next value of y.