回复: [求助]怎样求和含有未知数的表达式?
Thanks a lot. 自己试着编写了类似程序:
syms x;
y=0;
p=0;
syms x;
while (p<10)
p=p+1;
y=y+trimf1(x,[p p+1])
end;
solve(y-0.25),显示出每一步y的表达式为:
y =
(x-2)/(x-1)
y =
(x-2)/(x-1)+(x-3)/(x-2)
y =
(x-2)/(x-1)+(x-3)/(x-2)+(x-4)/(x-3)
y =
(x-2)/(x-1)+(x-3)/(x-2)+(x-4)/(x-3)+(x-5)/(x-4)
y =
(x-2)/(x-1)+(x-3)/(x-2)+(x-4)/(x-3)+(x-5)/(x-4)+(x-6)/(x-5)
y =
(x-2)/(x-1)+(x-3)/(x-2)+(x-4)/(x-3)+(x-5)/(x-4)+(x-6)/(x-5)+(x-7)/(x-6)
y =
(x-2)/(x-1)+(x-3)/(x-2)+(x-4)/(x-3)+(x-5)/(x-4)+(x-6