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.
Most nonzero elements in row
Make a run-length companion vector
frame of the matrix
Integer Sequence - II : New Fibonacci
Find the treasures in MATLAB Central and discover how the community can help you!
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