Problem 45497. Four digit number ABCD reversal
77.27% Correct | 22.73% Incorrect
Last Solution submitted on Oct 24, 2022
Michael on 7 May 2020
You really shouldn't give away the answer in the test suite. ;-)
You could change the test suite to something like:
assert (str2num(fliplr(num2str(y))) == y*4);
Although this also sort of gives away one possible solution.
Solution CommentsShow comments
Problem Recent Solvers41
Duplicate each element of a vector.
Reverse the elements of an array
Determine the length of a string of characters
More from this Author2
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!