I think you have your W and H mixed up in your example and test suite.
Thanks James, I've fixed it now.
I also used round, but I not seen to be the best solution.
36.6/20.6==16/9 is false.
The values from the test suite are also inaccurate.
6318 Solvers
Convert a vector into a number
507 Solvers
Getting the absolute index from a matrix
213 Solvers
Given a matrix, swap the 2nd & 3rd columns
535 Solvers
Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
777 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!