不怎么懂符号表达式的东西。想得到一个函数组成的向量,程序如下 syms xi;
for i=1:(n(1)+1)
fai1(i)=0;
for p=1:(n(1)+1)
fai1(i)=fai1(i)+2/n(1)/c1(i)*(1/c1(p)*cos(p*acos(gChebyRoot(i,1)))*cos(p*acos(xi)));
end
end
除了xi其他都是数值,想生成fai,一个符号表达式组成的向量。结果有如下错误:
??? The following error occurred converting from sym to double:
Error using ==> sym.double at 29
DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use the VPA function instead.
习惯不同, 参考下
syms xi; fai1=sym(zeros(1,n+1));
for i=1:n+1
for p=1:n+1
fai1(i)=fai1(i)+2/n/c1(i)*(1/c1(p)*cos(p*acos(gChebyRoot(i,1)))*cos(p*acos(xi)));
end
end