Given a larger and smaller matrix, perform element-by-element multiplication on the smaller matrix and a sub-matrix of the larger matrix with a given offset. Return that matrix. For example, given
m =
[ 17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9 ]and
n =
[ 1 1 1
1 1 1 ]and o = [2 3], the result would be
7 14 16 13 20 22
The overlap of the two matrices will always be valid, so [4 5] would not be a valid offset for this example problem.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers66
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
52675 Solvers
-
given 3 sides, find area of this triangle
819 Solvers
-
Unique values without using UNIQUE function
440 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
1256 Solvers
-
Convert given decimal number to binary number.
2272 Solvers
More from this Author11
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
The current test suite considers the input n as flat and square matrices (i.e., size(n,1) <= size(n,2)). It is recommended that tall matrix (size(n,1) > size(n,2)) should also be added in order to make the test suite more comprehensive.
Updated test suite.