Make a vector of prime numbers - MATLAB Cody - MATLAB Central

Problem 1567. Make a vector of prime numbers

Difficulty:Rate

Input(n) - length of vector with prime numbers

Output(v) - vector of prime numbers

Example:

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

Solution Stats

43.62% Correct | 56.38% Incorrect
Last Solution submitted on Jan 14, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers797

Suggested Problems

More from this Author9

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page