init
This commit is contained in:
15
FOTF Toolbox/kronsum.m
Normal file
15
FOTF Toolbox/kronsum.m
Normal file
@ -0,0 +1,15 @@
|
||||
function C=kronsum(A,B)
|
||||
% kronsum - evaluate the Kronecker sum of two matrices
|
||||
%
|
||||
% C=kronsum(A,B)
|
||||
%
|
||||
% A, B - the two matrices
|
||||
% C - the kronecker sum of matrices A and B
|
||||
|
||||
% Copyright (c) Dingyu Xue, Northeastern University, China
|
||||
% Last modified 28 March, 2017
|
||||
% Last modified 18 May, 2022
|
||||
[ma,na]=size(A); [mb,nb]=size(B);
|
||||
A=reshape(A,[1 ma 1 na]); B=reshape(B,[mb 1 nb 1]);
|
||||
C=reshape(A+B,[ma*mb na*nb]);
|
||||
end
|
||||
Reference in New Issue
Block a user