matlab中关于符号向量的计算问题,求帮助clcclearu2=zeros(1,100);for i=1:101 u=sym('u',[1,101]);endfor i=1:100 b=sym('b',[1,100]); d=sym('d',[1,100]); a=sym('a',[1,100]);endu(1,1)=1;t=0:1:100;for i=1:100 b(1,i)=u(i+1)/2; d(1
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/07 03:52:54
![matlab中关于符号向量的计算问题,求帮助clcclearu2=zeros(1,100);for i=1:101 u=sym('u',[1,101]);endfor i=1:100 b=sym('b',[1,100]); d=sym('d',[1,100]); a=sym('a',[1,100]);endu(1,1)=1;t=0:1:100;for i=1:100 b(1,i)=u(i+1)/2; d(1](/uploads/image/z/5163591-39-1.jpg?t=matlab%E4%B8%AD%E5%85%B3%E4%BA%8E%E7%AC%A6%E5%8F%B7%E5%90%91%E9%87%8F%E7%9A%84%E8%AE%A1%E7%AE%97%E9%97%AE%E9%A2%98%2C%E6%B1%82%E5%B8%AE%E5%8A%A9clcclearu2%3Dzeros%281%2C100%29%3Bfor+i%3D1%3A101++++u%3Dsym%28%27u%27%2C%5B1%2C101%5D%29%3Bendfor+i%3D1%3A100+++b%3Dsym%28%27b%27%2C%5B1%2C100%5D%29%3B+++d%3Dsym%28%27d%27%2C%5B1%2C100%5D%29%3B+++a%3Dsym%28%27a%27%2C%5B1%2C100%5D%29%3Bendu%281%2C1%29%3D1%3Bt%3D0%3A1%3A100%3Bfor+i%3D1%3A100++++b%281%2Ci%29%3Du%28i%2B1%29%2F2%3B++++d%281)
matlab中关于符号向量的计算问题,求帮助clcclearu2=zeros(1,100);for i=1:101 u=sym('u',[1,101]);endfor i=1:100 b=sym('b',[1,100]); d=sym('d',[1,100]); a=sym('a',[1,100]);endu(1,1)=1;t=0:1:100;for i=1:100 b(1,i)=u(i+1)/2; d(1
matlab中关于符号向量的计算问题,求帮助
clc
clear
u2=zeros(1,100);
for i=1:101
u=sym('u',[1,101]);
end
for i=1:100
b=sym('b',[1,100]);
d=sym('d',[1,100]);
a=sym('a',[1,100]);
end
u(1,1)=1;
t=0:1:100;
for i=1:100
b(1,i)=u(i+1)/2;
d(1,i)=3^u(1,i);
a(1,i)=b(i)*d(i);
solve('u(1,i+1)-u(1,i)-a(1,i)','u(1,i+1)');
u2(i)=vpa(u(1,i+1));
end
u2
一下是运行时的问题:
Warning: 2 equations in 0 variables.
Warning: Explicit solution could not be found.
> In solve at 81
In Untitled at 18
? The following error occurred converting from sym to double:
Error using ==> mupadmex
Error in MuPAD command: DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use the VPA function instead.
Error in ==> Untitled at 19
u2(i)=vpa(u(1,i+1));
matlab中关于符号向量的计算问题,求帮助clcclearu2=zeros(1,100);for i=1:101 u=sym('u',[1,101]);endfor i=1:100 b=sym('b',[1,100]); d=sym('d',[1,100]); a=sym('a',[1,100]);endu(1,1)=1;t=0:1:100;for i=1:100 b(1,i)=u(i+1)/2; d(1
clc % 改了下程序.还有问题,告诉我题目,我帮你编程.
clear
uu2=zeros(1,100);
u=sym('u',[1,101]) % 建符号矩阵
b=sym('b',[1,100]);
d=sym('d',[1,100]);
a=sym('a',[1,100]);
u(1,1)=1;
t=0:1:100;
for i=1:100 % 如果没猜错的话!
b(i)=u(i+1)/2;
d(i)=3^u(i);
a(i)=b(i)*d(i);
u(i+1) =solve(u(i+1)-u(i)-a(i),u(i+1));
uu2(i)=vpa(u(i+1));
end
uu2