code for sries and sequences

59 Views Asked by At

I want to know Matlab code for the following equation:

$$u_0(t)=t \\ u_i(t)= u_{i-1}(t)+ \sum_{j=0}^{i-1} u_{j}(s)u_{i-1-j}(s).$$ for $i=1,3,4,....$

I wrote this one code. but is is not run. I know the problem is setting index. but I don't know why. syms t for j=1:4 if j==1 u(j)=t; else sumf=0 for i=1:(j-1) f=(u(i))*(u(j-1-i)) sumf=sumf+f end u(j)=u(j-1)+sumf end end

1

There are 1 best solutions below

12
On
syms u t
u = {}
u{1} = t;
for k = 2:10
  u{k} = u{k-1};
  for j=1:k-1   u{k} = u{k} + u{j}.*u{k-j};  end
end
expand(u{10})