第三章练习

function Rxy=van(X,Y) Sxx=0; Syy=0; Sxy=0; pinX=mean(X); pinY=mean(Y); for i=1:size(X) Sxx=Sxx+(X(i)-pinX)^2; Syy=Syy+(Y(i)-pinY)^2; Sxy=Sxy+(X(i)-pinX)(Y(i)-pinY); end Rxy=Sxy/((SxxSyy)^(1/2)) ;

MALTAB DAY5for i = 1:1100 boll=1; for j =2:i-1 if(mod(i,j)==0) boll=0; end end if boll disp(i); end endx=input(“input a num”); A=zeros(x,x); zancun=1; for i = 1:x for j= 1:x A(i,j)=zancun; zancun=zancun+1; end end disp(A)MALTAB DAY5
x=input(“input a num”); A=zeros(x,x); zancun=1; for i = 1:x for j= 1:x A(i,j)=zancun; zancun=zancun+1; end end disp(A)x=input(“input a num”); A=zeros(x,x); zancun=1; for i = 1:x for j= 1:x A(i,j)=zancun; zancun=zancun+1; end end disp(A)MALTAB DAY5

相关文章:

  • 2021-09-27
  • 2022-02-22
猜你喜欢
  • 2022-01-23
  • 2021-04-23
  • 2022-01-11
  • 2021-12-06
  • 2021-08-04
相关资源
相似解决方案