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.
Find all elements less than 0 or greater than 10 and replace them with NaN
Longest Divisor Run
"Low : High - Low : High - Turn around " -- Create a subindices vector
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