Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use Matlab, please. Create a function that performs the following tasks. Create an array that includes the first N integers. N will be an

image text in transcribed

Please use Matlab, please. Create a function that performs the following tasks. Create an array that includes the first N integers. N will be an input parameter. Create an array with the primes from 0 to N using the function primes(n). By comparing the two arrays, changes on your original array the values of the prime numbers by 0. You can not use a build in Matlab function for the comparison process. Return the sum of the resulting array. Example: o N = 11 Array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] o Primes = [1, 2, 3, 5, 7, 11] o New_array = [0,0,0,4,0,6,0,8,9,10,0] O Result sum = 37

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

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

6. What questions would you suggest should be included?

Answered: 1 week ago