不知道这样行不行:可以这样:>> A = [2,4;5,6]A = 2 4 5 6>> [m,n] = size(A)m = 2n = 2>> B = repmat(1:n,[m,1])B = 1 2 1 2>> C = kron(A,[0,1])+kron(B,[1,0])C = 1 2 2 4 1 5 2 6
加上后那就不是数值矩阵了呀?你要干什么呢?