Really, you need to add more test cases. You're not even testing that your condition of 'ensuring that the datatype of the input image matrix is preserved' has been fulfilled.
How to find the position of an element in a vector without using the find function
2478 Solvers
284 Solvers
Back to basics - mean of corner elements of a matrix
297 Solvers
105 Solvers
find the surface area of a cube
336 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!