write a MATLAB function to find the four-digit number ABCD when multiplied by 4 returns DCBA. The function takes an input x=4.
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers50
Suggested Problems
-
28051 Solvers
-
Return the largest number that is adjacent to a zero
5526 Solvers
-
Flip the main diagonal of a matrix
914 Solvers
-
Find the maximum number of decimal places in a set of numbers
3547 Solvers
-
Convert given decimal number to binary number.
2345 Solvers
More from this Author2
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
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.