This looks much (c)leaner than the REGEXP method.
while on the topic of 'undocumented trivia that will earn you a couple of cody points for no good reason', have you seen this one?
I believe this is the very first use of the Ans Hack in Cody. See http://blogs.mathworks.com/community/2016/06/23/the-great-ans-hack/
interesting use of strread to turn a string into a cell array (though probably only really useful in cody)
Kids, don't try this at home. :-)
This solution was proposed by Oleg Komarov.
Make the vector [1 2 3 4 5 6 7 8 9 10]
Change the sign of even index entries of the reversed vector
Add two numbers
Given a matrix, return the last eigen value
Twins in a Window
Beads on a Necklace (Convex Hulls)
Remove the air bubbles
Find the Final State of an Abelian Sandpile
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