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.
Michael C. had a good point, but you also need "assert(numel(unique(cube3()))==3)"
Yo may need to check for length 3
Add a test to assert that length == 3.
hay
It would be a good idea to check that a length 3 vector is returned.
Return unique values without sorting
600 Solvers
Test if two numbers have the same digits
190 Solvers
267 Solvers
371 Solvers
275 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!