I would like to do an element-wise matrix multiplication using the following 2x2x3 matrix in MATLAB
>> filter_1
filter_1(:,:,1) =
0 1
0 0
filter_1(:,:,2) =
1 0
0 1
filter_1(:,:,3) =
0 0
1 0
This matrix will turn out to zero some elements in some matrix dimensions if used in an element-wise multiplication. For example, given another 2x2x3 matrix:
>> frames_original{1}
ans(:,:,1) =
92 87
93 93
ans(:,:,2) =
69 66
72 71
ans(:,:,3) =
42 40
40 43
If I do the element-wise matrix multiplication, it will let some values remain in the resulting matrix, the others will turn out to zero:
>> filtered=double(frames_original{1}).*filter_1
filtered(:,:,1) =
0 87
0 0
filtered(:,:,2) =
69 0
0 71
filtered(:,:,3) =
0 0
40 0
However, this only works if both matrices are of the same size (2x2x3). Now, suppose that I have a big matrix, like a 1500x1500x3 matrix. How to 'slide' my 2x2x3 window performing the element-wise multiplication dealing with the matrix borders accordingly? If using N-D convolution, it doesn't work, as MATLAB deals with this operation as an even-dimensional-window convolution, and what I want is an element-wise multiplication.
Is there any way to do element-wise matrix multiplication using one big matrix and another smaller in MATLAB?
EDIT: The solution for Element wise multiplication of matrices of differing dimensions doesn't work for me because it involves a different element-wise multiplication and requires reshaping, which is what I don't want.