what the value of array in decimal
2 次查看(过去 30 天)
显示 更早的评论
F(1)=0;
F(2)=1;
F(3)=-5;
for k=1:10
A=0;
for m=1:k
A=A-2*a1*Re*F(m)*(k-m+1)*F(k-m+2);
end
F(k+3)=(A/((k)*(k+1)*(k+2)))-((4*a1^2*k*F(k+1))/((k)*(k+1)*(k+2)));
end
% disp(F)
for k=1:1:12
series1(x)=series1(x)+F(k)*(power(x,k-1));
end
series1
for x=1:11
e=(x-1)/10
U1(x)=series1(e)
end
I want the value of U1(x) in decimal form .I use the command disp( U1) ,it is no doubt displaying the value but in the fraction form and Iwant in decimal form.In addition to that I want to plot the graph for different value of e.
0 个评论
采纳的回答
Walter Roberson
2021-3-16
a1 and Re are undefined.
series1 and x are undefined at the point where you first use them.
I suspect that you initialized
syms x
which is not the proper thing to do in this case: if x is symbolic then series1(x) would be a symbolic function, but you cannot define a symbolic function in terms of itself (the series(x) on the right hand side.)
6 个评论
Walter Roberson
2021-3-18
It means that my demonstration is running on a system that does not support input(), so I arranged the code to detect that it is not running on Windows and to use constant values for alpha and Re. If the same code were to be run on Windows it would prompt for inputs.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!