For example,
say we have two matrices as follows:
>> A = [1 2;3 4]A = 1 2 3 4>> B = [5 6;7 8]B = 5 6 7 8>> kron(A,B)ans = 5 6 10 12 7 8 14 16 15 18 20 24 21 24 28 32
However I want a matrix that will subtract every component of matrix A by every component of matrix B, yielding a 4×4 matrix as follows:
A - B = [-4 -5 -3 -4;-6 -7 -5 -6;-2 -3 -1 -2;-4 -5 -3 -4]
Note that I switched the multiplication function with subtraction BY HAND here. I need to do this with two 100×100 matrices, so it wouldn't be so easy. Thanks
Best Answer