主题:编程求助
例如f(x)=a+bx, x=[1,2,3,4,5] 求f(x)的连积值
F(x)=f(1)*f(2)*f(3)*f(4)*f(5)
>> syms a b;
>> x=[1,2,3,4,5];
>> f=cumprod(a*x+b)
为何不对,会出现
???Error using cumprod
Fuction cumprod is not defined for values of class 'sym'
>> x=[1,2,3,4,5];
>> f=cumprod(2x+1)是对的。
如果是上面定义有问题该怎么来解决呢?
F(x)=f(1)*f(2)*f(3)*f(4)*f(5)
>> syms a b;
>> x=[1,2,3,4,5];
>> f=cumprod(a*x+b)
为何不对,会出现
???Error using cumprod
Fuction cumprod is not defined for values of class 'sym'
>> x=[1,2,3,4,5];
>> f=cumprod(2x+1)是对的。
如果是上面定义有问题该怎么来解决呢?