commutation.m

来自「计量工具箱」· M 代码 · 共 35 行

M
35
字号
function K=commutation(m,n)% ----------------------------------------------------------% PURPOSE: given any (m X n) matrix A returns the (mn X mn) K%          matrix such that: vec(A')=K*vec(A).% -----------------------------------------------------------% USAGE: K=commutation(m,n) where m and n are the numbers of %         rows and columns of matrix A.% -----------------------------------------------------------        % written by% Marco Aiolfi% maiolfi@iol.it% Bocconi University and Banca Intesa, Milanif nargin == 1   n=mend% a=normrnd(1,1,m,n); this was replaced by LeSagea = randn(m,n) + ones(n,m);x=a(:);puto=a';y=puto(:);z=x*y';K=zeros(m*n);for i=1:m*n   for j=1:m*n      if sqrt(z(i,j))==abs(x(i))         K(i,j)=1;      else         K(i,j)=0;      end   endend

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?