Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab Function Name: kraken Inputs: 1. (double) A number representing the upper limit of primes to output Outputs: 1. (double) A 1xN vector containing all

image text in transcribed
Matlab Function Name: kraken Inputs: 1. (double) A number representing the upper limit of primes to output Outputs: 1. (double) A 1xN vector containing all prime numbers less than or equal to the upper limit number Banned Functions built-in prime function Background: primes, isprime, nextprime, prevprime, nthprime, factor or any other You are planning a journey across Prime Sea, where only creatures with a prime number of tentacles can live. Terrified of many-limbed monsters, you do some research and find out the greatest number of tentacles ever observed on a creature in Prime Sea. However, this gets you hinking about all the other smaller, but just as scary, monsters out there. You decide to use MATLAB to help you find all the other possible tentade counts of creatures in Prime Sea Function Description: up to and including n. Remember that a prime number only has two factors: 1 and itself. Example: Write a function that takes in a prime number, n, and outputs a vector of prime numbers tentacles kraken(7) tentacles-(2 35 7 Notes: All inputs will be 2 or greater 1 is not a prime number The mod () function will be helpful to check for divisibility

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

6. How do histories influence the process of identity formation?

Answered: 1 week ago