matlab的幻方程序
(2010-04-09 21:42:36)
标签:
matlab幻方程序杂谈 |
分类: 学习知识 |
程序如下所示:
function main()
num=input('input the naumber n of [n*n]:')
a=perms('123456789');
a
m1=length(a(1,:));
n1=length(a(:,1));
for m=1:n1
b(m,n)=str2num(a(m,n));
fprintf('362880')
m
end
jishu1=1;
jishu2=1;
for i=1:n1;
for hang=1:num
end
end
m1=length(a(1,:));
n1=length(a(:,1));
t=0;
for m=1:m1
end
%************矩阵a中行数求和*********
function he=hangsum(a)
num=length(a(1,:));
he=zeros(num,1);
for i=1:num
end
%************矩阵a中列数求和*********
function he=liesum(a)
num=length(a(:,1));
he=zeros(1,num);
for i=1:num
end