用个循环吧,你看下:symsp2nc2nNrp2rc2rBTp1nxc1nARLmaxSmaxLmaxDq2nq2rw2nw2rrr=0.1:0.05:0.6;n=length(rr);N=300;R=200;c2n=60;c1n=60;c2r=30;B=6000;A=10;p1n=240;f=5;fori=1:n r=rr(i);p2n=(6*N+2*c2n+18*N*r+5*R*r+8*c2n*r+c2r*r+3*f*r+15*N*r^2+3*N*r^3+10*R*r^2+3*R*r^3+10*c2n*r^2+4*c2n*r^3+3*c2r*r^2+2*c2r*r^3+9*f*r^2+6*f*r^3)/(12*r^3+38*r^2+32*r+8);p2r=(6*R+2*c2r+2*f+5*N*r+18*R*r+c2n*r+8*c2r*r+8*f*r+10*N*r^2+3*N*r^3+15*R*r^2+3*R*r^3+3*c2n*r^2+2*c2n*r^3+10*c2r*r^2+4*c2r*r^3+11*f*r^2+6*f*r^3)/(12*r^3+38*r^2+32*r+8);w2n=(2*N+2*c2n+2*N*r+R*r+4*c2n*r+c2r*r+3*f*r+2*c2n*r^2+c2r*r^2+3*f*r^2)/(3*r^2+8*r+4);w2r=(2*R+2*c2r+2*f+N*r+2*R*r+c2n*r+4*c2r*r+4*f*r+c2n*r^2+2*c2r*r^2+3*f*r^2)/(3*r^2+8*r+4);q2n=N-p2n-r*(p2n-p2r);q2r=R-p2r+r*(p2n-p2r);maxS(i,1)=(w2n-c2n).*q2n+f.*q2r;endplot(rr,double(maxS),'*')
追问不好意思,我看不懂,你能解释一下吗?麻烦你了