bisect为二分法解方程指令,照书上编的,没有问题<BR>demof_1与demof_11为定义的要解的函数。<BR>程序如下:<BR> Cl=5000;Cs=3200;<BR>Cp=0:100:9000;c=1;a=1;<BR>for i=1:length(Cp) <BR>if Cp(i)>0&Cp(i)<Cs<BR> Cp1=Cp(i);<BR> fd(a)=bisect('demof_1',0,10e4,10);<BR> fd1(a)=bisect('demof_11',0,10e4,10);<BR> Cpfd(a)=Cp(i);<BR> Cpfd1(c)=Cp(i);<BR> a=a+1;c=c+1;<BR>else continue;<BR>end<BR>end<BR>plot(fd,Cpfd)<BR>hold on<BR>plot(fd1,Cpfd1)<BR> |