The test suite only seems to work if the n primes each have the same number of digits. For example, with n=3, a perfectly good answer would be [5,7,11], but this crashes the test suite. It could be fixed by using combine=strcat(combine,strtrim(b(i,:)));
@William: your suggestion has been incorporated into the test suite.
Thank you both for improving the quality of this problem. Cheers, Doddy.
Arrange vector in ascending order
629 Solvers
Accessing elements on the diagonal
87 Solvers
Sum the numbers on the main diagonal
465 Solvers
Convert given decimal number to binary number.
719 Solvers
Flip the vector from right to left
3110 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!