Problem 1356. Equal to their cube
Solution Stats
Problem Comments
-
5 Comments
Show
2 older comments
Michael C.
on 18 Mar 2013
Might be a good idea to change the test suite to "assert(isequal(cube3(),cube3().^3))" so that the answer isn't revealed by looking at the test suite.
Nicholas Howe
on 25 Apr 2013
Michael C. had a good point, but you also need "assert(numel(unique(cube3()))==3)"
Daniel Pereira
on 27 Apr 2016
Yo may need to check for length 3
Jihye Sofia Seo
on 9 Feb 2017
Add a test to assert that length == 3.
Hoang Vu
on 22 Sep 2019
hay
Solution Comments
-
1 Comment
Andrew
on 31 Mar 2014
It would be a good idea to check that a length 3 vector is returned.
Problem Recent Solvers386
Suggested Problems
-
Basics: 'Find the eigenvalues of given matrix
385 Solvers
-
07 - Common functions and indexing 1
408 Solvers
-
648 Solvers
-
Rounding off numbers to n decimals
3090 Solvers
-
Back to Basics - Find no. of elements in a matrix?
285 Solvers
More from this Author13
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!