Padded with 0's in convolution kernel to avoid collisions
Wow, using a string really cuts down on solution size.
Can someone please tell me whats going on?!
The reshape function creates a matrix with the vector [1 3 9 27] placed vertically, horizontally, and diagonally; the conv2 function does sort of a dot product of these with all sets of four elements in the test matrix; if [1 1 1 1] or [2 2 2 2] appears, the result will be 40 or 80, respectively.
This code is referenced in the following blog post: http://blogs.mathworks.com/community/2015/01/19/robot-game-playing-in-matlab-part-2/
Read a column of numbers and interpolate missing data
1253 Solvers
Back to basics 11 - Max Integer
681 Solvers
758 Solvers
Get the elements of diagonal and antidiagonal for any m-by-n matrix
274 Solvers
2217 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!