Matlab大神求助这个代码错误怎么解?t=[1;2;3]; ppi=[90;80;70]; [n,m]=size(t); aa=zeros(n,m)bb=zeros(n,m)for i=1:2:n-1t1= t(i,1);t2=t(n,1);pp=ppi(i,1);ppn= ppi(n,1)% [a,b]=solve(' x/t(i,1)-(ln(1/(1-90/100)))^(1/y)=0','x/2-(ln(1/(1-80/100)))^
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/29 01:21:15
Matlab大神求助这个代码错误怎么解?t=[1;2;3]; ppi=[90;80;70]; [n,m]=size(t); aa=zeros(n,m)bb=zeros(n,m)for i=1:2:n-1t1= t(i,1);t2=t(n,1);pp=ppi(i,1);ppn= ppi(n,1)% [a,b]=solve(' x/t(i,1)-(ln(1/(1-90/100)))^(1/y)=0','x/2-(ln(1/(1-80/100)))^
Matlab大神求助这个代码错误怎么解?
t=[1;2;3]; ppi=[90;80;70]; [n,m]=size(t); aa=zeros(n,m)bb=zeros(n,m)for i=1:2:n-1t1= t(i,1);t2=t(n,1);pp=ppi(i,1);ppn= ppi(n,1)% [a,b]=solve(' x/t(i,1)-(ln(1/(1-90/100)))^(1/y)=0','x/2-(ln(1/(1-80/100)))^(1/y)=0'); [a,b]=solve('x/t1-(ln(1/(1-pp/100)))^(1/y)=0','x/tn-(ln(1/(1- ppn/100)))^(1/y)=0');a1=double(a);b1=double(b);aa(i,1)=a1;bb(i,1)=b1;endaabb错误提示:DOUBLE cannot convert the input expression into a double array.If the input expression contains a symbolic variable,use the VPA functioninstead.
Matlab大神求助这个代码错误怎么解?t=[1;2;3]; ppi=[90;80;70]; [n,m]=size(t); aa=zeros(n,m)bb=zeros(n,m)for i=1:2:n-1t1= t(i,1);t2=t(n,1);pp=ppi(i,1);ppn= ppi(n,1)% [a,b]=solve(' x/t(i,1)-(ln(1/(1-90/100)))^(1/y)=0','x/2-(ln(1/(1-80/100)))^
t=[1;2;3];
ppi=[90;80;70];
[n,m]=size(t);
aa=zeros(n,m);
bb=zeros(n,m);
for i=1:2:n-1
t1= t(i,1);
t2=t(n,1);
pp=ppi(i,1);
ppn= ppi(n,1)
[a,b]=solve(' x/t-(ln(1/(1-90/100)))^(1/y)=0','x/2-(ln(1/(1-80/100)))^(1/y)=0');
%[a,b]=solve('x/t1-(ln(1/(1-pp/100)))^(1/y)=0','x/t2-(ln(1/(1- ppn/100)))^(1/y)=0');
t=t1;
a=subs(a)
b=subs(a)
a1=double(a);
b1=double(b);
aa(i,1)=a1;
bb(i,1)=b1;
end
aa
bb
原来的程序,主要的错误是:[a,b]=solve(……),这个命令得到的解含有符号变量(contains a symbolic variable),不能直接用double命令,必须先用subs()命令来替换里面的符号变量,才能用double命令.