1 / 6

数学建模

数学建模. 程 序 设 计. clear clc n=5; for i=1:n for j=1:n A(i,j)=n*(i-1)+j; end end A. clear clc n=5; for i=1:n for j=1:n A(i,j)=n*(i-1)+j; end end A’. (1). (2). clear clc n=5; for i=1:n for j=1:n if mod(i,2)==1 A(i,j)=n*(i-1)+j; else

Download Presentation

数学建模

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 数学建模 程 序 设 计

  2. clear clc n=5; for i=1:n for j=1:n A(i,j)=n*(i-1)+j; end end A clear clc n=5; for i=1:n for j=1:n A(i,j)=n*(i-1)+j; end end A’ (1) (2)

  3. clear clc n=5; for i=1:n for j=1:n if mod(i,2)==1 A(i,j)=n*(i-1)+j; else A(i,j)=n*(i)+1-j; end end end A clear clc n=5; for i=1:n for j=1:n if mod(i,2)==1 A(i,j)=n*(i-1)+j; else A(i,j)=n*(i)+1-j; end end end A' (3) (4)

  4. clear clc n=10;k=1;r=1; for i=2:2*n if i>n+1 r=i-n; end for j=r:i-r A(j,i-j)=k; k=k+1; end end A clear clc k=1; for m=1:5 for i=1:5; for j=1:5 if abs(i-j)==m-1; A(i,j)=k; end end end k=k+1; end A (6) (5)

  5. clear clc k=1; for m=1:5 for i=k:5; for j=k:5 if (i==m | j==m) A(i,j)=k; end end end k=k+1; end A clear clc n=5; r1=4; r2=1; r3=1; r4=5; x=[]; for i=1:5 x=[x,ones(1,r1)*r2,r3:(-1)^(i-1):r4]; r1=r1-1; r2=5-r2+1+(1+(-1)^i)/2;r2 r3=5-r3+1+(1+(-1)^i)/2;r3 r4=5-r4+1+(1+(-1)^(i+1))/2;r4 end x (8) (7)

More Related