Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Problem 1567. Make a vector of prime numbers

Created by Marek Kuklis

Input(n) - length of vector with prime numbers

Output(v) - vector of prime numbers


  • n=1; v=2
  • n=3; v=[2 3 5]
  • n=7; v=[2 3 5 7 11 13 17]


Problem Group

Solution Statistics

38 correct solutions 51 incorrect solutions
Last solution submitted on Oct 28, 2014