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

New to MATLAB?

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

41 correct solutions 55 incorrect solutions
Last solution submitted on May 17, 2015