I think the numbers in the description may be wrong. For hexagonal numbers, shouldn't the progression be [1,6,15,28]?
I believe that test suite number 6 is a little bit unfair, since the difficulty of this problem relies on creating the function that gives the n-th s-gonal number, and not making use of meshgrid or bsxfun.
Remove test case 6 please.. it makes no sense
Explain why. It makes a lot of sense to me, and it's a lot easier (and makes even more educational sense) with 2016b. Just learn the difference between * and .* and ask yourself you need 1st or 2nd.
Determine if a Given Number is a Triangle Number
326 Solvers
Rotate input square matrix 90 degrees CCW without rot90
385 Solvers
466 Solvers
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
301 Solvers
2473 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!