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.
Compute a dot product of two vectors x and y
Change the sign of even index entries of the reversed vector
Say something funny
Area of a triangle
Find the 9's Complement
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