Given an n-dimensional array M, find the size of M along the k-th dimension (1 <= k <= n), without using size(), height() or width(). You may ignore trailing singleton dimensions.
Solution Stats
Problem Comments
4 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers8
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15777 Solvers
-
3993 Solvers
-
1713 Solvers
-
35 Solvers
-
223 Solvers
More from this Author19
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
The test cases use undefined variables.
@Tim, everything is set before the first test case runs.
Interesting. We can't see anything before the first test, but it's there. For example, I couldn't test my code by pasting the tests into the scratch window, but I could submit and run it successfully. I've thought that CP 2166 is unsolvable because of missing code, but maybe it's just not visible.
@Chris, it's a quirk of Cody I recently discovered: if you submit a problem, all code in the test suite before the first section marker is run before the test suite but not shown as part of the test code. I used this feature (if it is indeed one) here partly in order to try it out, and partly in order to make cheating just a little bit harder.
If the consensus is that this hinders legitimate solutions, I can of course edit the problem to make the hidden code visible.