MATLAB 用for循环给数组赋值的问题

2024-11-29 16:24:24
推荐回答(1个)
回答1:

x0=2;x1=2;x2=8;x3=3;x4=5;x5=4;%--------假设的值
for i=1:21
u=0:0.05:1;
x(i)=x0+x1*power(u(i),2)+x2*power(u(i),3)+x3*power(u(i),3)+x4*power(u(i),4)+x5*power(u(i),5);
end