求助:各位大虾谁能帮我把这2个BASIC程序变成MATLAB
<P>1,SCREEN 2:CLS<BR>DIM X(9000)<BR>X(1)=0.8<BR>mstart=3.0 mend=4:n=60<BR>mol=(mend-mstart)/n<BR>for g=0.4 TO 2.8 START 0.1<BR> FOR K=mstart TO mend STEP mol<BR> for I=1 TO 200<BR> X(2*I)=K*X(2*I-1)*(1-X(2*I-1))<BR> X(2*I+1)=G*X(2*I)*(1-X(2*I))<BR> NEXT I<BR> FOR I=201 TO 500<BR> X(2*I)=K*X(2*I-1)*(1-X(2*I-1))<BR> X(2*I+1)=G*X(2*I)*(1-X(2*I))<BR> PSET(INT(300*K)-800,200-INT(90*(1+X(2*I)))<BR> PSET(INT(300*K)-800,200-INT(90*(1+X(2*I+1)))<BR> NEXT I<BR> NEXT K<BR> STOP:CLS<BR>NEXT G<BR>END<BR>2,SCREEN 2:CLS<BR>DIM X(9000)<BR>X(1)=0.8:K=15/4:G=8/3<BR>INPUT"m1,m2,X";M1,M2,X<BR>XMAX=X(1):XMIN=X(1)<BR>for I=1 TO 200<BR> X(2*I)=K*X(2*I-1)*(1-X(2*I-1))+M1*X(2*I-1)-X<BR> X(2*I+1)=G*X(2*I)*(1-X(2*I))+M2*X(2*I)-X)<BR> PSET(2*I,200-INT(90*(1+X(2*I))))<BR> PSET(2*I+1,200-INT(90*(1+X(2*I+1))))<BR>IF X(2*I)>XMAX THEN XMAX=X(2*I)<BR>IF X(2*I)<XMIN THEN XMAX=X(2*I)<BR>IF X(2*I+1)>XMAX THEN XMAX=X(2*I+1)<BR>IF X(2*I+1)<XMIN THEN XMAX=X(2*I+1)<BR>NEXT I<BR>LINE(2,200-INT(90(1+XMIN))-15)-(2,200-INT(90(1+XMAX))+15)<BR>LINE(2,200-INT(90(1+XMIN))-15)-(420,200-INT(90(1+XMIN))-15)<BR>LINE(2,200-INT(90(1+XMAN))+15)-(420,200-INT(90(1+XMAX))+15)<BR>LINE(420,200-INT(90(1+XMIN))+15)-(420,200-INT(90(1+XMAX))+15)<BR>END</P><P>谢谢!!</P> 这两个程序不复杂,关键是搞清楚里边的循环
别人只能给你提供意见,帮你该写估计不会有这时间
页:
[1]