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

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Given an input vector of positive integers, return a row vector with the primes first (in increasing order) and the composites next (also in increasing order).

The number 1 is neither prime nor composite. Put it with the composites for this problem.

107 correct solutions
117 incorrect solutions

Last solution submitted on Jan 28, 2015

1 Comment

Bart
on 10 Mar 2012

Maybe a test case with a non-sorted input would be nice

4 Comments