Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Nigel Davies submitted a Comment to Solution 122786

Sorry, I just applied a slightly involved ans trick to the previous best solution. I hurts me though that the best solution involves a for loop.

on 3 Aug 2012