Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 2 : Two prime number - related functions a ) Write your own MATLAB ( or Octave ) function to check if a number
Task : Two prime numberrelated functions
a Write your own MATLAB or Octave function to check if a number is a prime.
Your function shall take a natural number as an input and return a boolean value to
indicate if the input number is prime return value true or not return value false
b Write a MATLAB or Octave function which takes a number n as an input parameter
and returns a vector which contains the rst n prime numbers.
You are only allowed to use basic arithmetics addition subtraction, multiplication,
division, modulo together with ifelsebranching, forloops and whileloops for this
part of the project.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started