zhaolei 发表于 2006-5-15 15:26

求助:那位高手帮我把这个BASIC程序变成MATLAB程序

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>谢谢<BR>

zhaolei 发表于 2006-5-15 15:43

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)&gt;XMAX THEN XMAX=X(2*I)<BR>IF X(2*I)&lt;XMIN THEN XMAX=X(2*I)<BR>IF X(2*I+1)&gt;XMAX THEN XMAX=X(2*I+1)<BR>IF X(2*I+1)&lt;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
页: [1]
查看完整版本: 求助:那位高手帮我把这个BASIC程序变成MATLAB程序