max1) ik=..._概率密度曲线怎么画matlab">
赞
踩
subroutine sub(n)
integer i,j,k,ik,n
real max1,m,sum
real a(n,n+1),x(n),b(n+1)
print*,"请按行输入增广矩阵元素"
read(*,*) ((a(i,j),j=1,n+1),i=1,n)
do k=1,n-1,1
ik=k
max1=abs(a(k,k))
do i=k+1,n
if (abs(a(i,k))>max1) ik=i
enddo
if(max1<1e-6) stop "此方程无解或解不唯一"
do j=k,n+1
b(j)=a(k,j)
a(k,j)=a(ik,j)
a(ik,j)=b(j)
enddo
do i=k+1,n
m=a(i,k)/a(k,k)
do j=k+1,n+1
a(i,j)=a(i,j)-m*a(k,j)
enddo
enddo
enddo
x(n)=a(n,n+1)/a(n,n)
do i=n-1,1,-1
sum=0
do j=i+1,n
sum=sum+a(i,j)*x(j)
enddo
x(i)=(a(i,n+1)-sum)/a(i,i)
enddo
write(*,*) (x(i),i=1,n)
end
program aa
integer d
print*,"请输入数组的维数"
read*,d
call sub(d)
end
◆◆
评论读取中....
请登录后再发表评论!
◆◆
修改失败,请稍后尝试
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。