Was able to reduce size a few times and finally got to this solution by borrowing tricks used by Grzegorz Knor and Dan.
Can you explain what the +'01'-'0' is doing? I don't see how i+'01'-'0'=[i,i+1].
'01 ' is a char vector of 2 positions: '0' ans '1'.
If you subtract '0' to it, it results a char vector with characters 0 and 1.
So '01'-'0' is the same as [0 1], but because of the '', it cost less operations.
Count from 0 to N^M in base N.
Project Euler: Problem 4, Palindromic numbers
Wrapping the Tower of Pisa
Get the elements of diagonal and antidiagonal for any m-by-n matrix
MATLAB Basic: rounding IV
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office