matlab 为什么本代码中间的if语句块不起作用啊?a=0.5;b=0.5;t=0:0.1:8;n=0:0.1:8;F=0:0.1:8;N=0:0.1:8;S=dsolve('DN=r*N*(1-N/K)*(1-89.01*(exp(-1.197*t)-exp(-2.877*t))/M)','Dn=r*n*(1-n/K)','N(0)=a','n(0)=b');for i=1:81F(i)=1;N(i)=exp(F(i)/18
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/22 02:50:29
matlab 为什么本代码中间的if语句块不起作用啊?a=0.5;b=0.5;t=0:0.1:8;n=0:0.1:8;F=0:0.1:8;N=0:0.1:8;S=dsolve('DN=r*N*(1-N/K)*(1-89.01*(exp(-1.197*t)-exp(-2.877*t))/M)','Dn=r*n*(1-n/K)','N(0)=a','n(0)=b');for i=1:81F(i)=1;N(i)=exp(F(i)/18
matlab 为什么本代码中间的if语句块不起作用啊?
a=0.5;b=0.5;
t=0:0.1:8;
n=0:0.1:8;
F=0:0.1:8;
N=0:0.1:8;
S=dsolve('DN=r*N*(1-N/K)*(1-89.01*(exp(-1.197*t)-exp(-2.877*t))/M)','Dn=r*n*(1-n/K)','N(0)=a','n(0)=b');
for i=1:81
F(i)=1;
N(i)=exp(F(i)/18221*2.4*(18221*t(i)*M+1354930*exp(-1197/1000*t(i))-563730*exp(-2877/1000*t(i)))/M)/(exp(1/18221*2.4*(18221*t(i)*M+1354930*exp(-1197/1000*t(i))-563730*exp(-2877/1000*t(i)))/M)-exp(2.4/M)^(791200/18221)*(-1+a)/a);
n(i)=F(i)/(1-exp(-2.4*t(i))*(-1+b)/b);
A(i)=N(i)+n(i);
if abs(A(i)-1)==0
for j=i;81
F(i)=1;
N(j)=exp(F(j)/18221*2.4*(18221*t(j)*M+1354930*exp(-1197/1000*t(j))-563730*exp(-2877/1000*t(j)))/M)/(exp(1/18221*2.4*(18221*t(j)*M+1354930*exp(-1197/1000*t(j))-563730*exp(-2877/1000*t(j)))/M)-exp(2.4/M)^(791200/18221)*(-1+a)/a);
n(j)=1-N(j);
A(j)=1;
end
end
end
plot(t,N);
hold on;
plot(t,n,'r');
hold on;
plot(t,A,'g')
matlab 为什么本代码中间的if语句块不起作用啊?a=0.5;b=0.5;t=0:0.1:8;n=0:0.1:8;F=0:0.1:8;N=0:0.1:8;S=dsolve('DN=r*N*(1-N/K)*(1-89.01*(exp(-1.197*t)-exp(-2.877*t))/M)','Dn=r*n*(1-n/K)','N(0)=a','n(0)=b');for i=1:81F(i)=1;N(i)=exp(F(i)/18
你的M值是什么,S求解了也没用?!