Answered step by step
Verified Expert Solution
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
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
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