CODE IN MATLAB and use a while loop: Write a function called FindPrimes that takes 2...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
CODE IN MATLAB and use a while loop: Write a function called FindPrimes that takes 2 scalars, lowerrange and upperrange and produces an output array called outprimes. INSTRUCTIONS: outPrimes contains all prime numbers about the lowerrange in ascending or- der while the sum of out Primes is less than the highest element of outEvens. Given the following: lowerrange = 2; upperrange= 20; [outevens, outprimes ] = FindPrimes (lowerrange, upperrange) [out Evens] = [2 4 8 10 14 16 20] We want our code to produce: out Primes [2 3 5 7] CODE IN MATLAB and use a while loop: Write a function called FindPrimes that takes 2 scalars, lowerrange and upperrange and produces an output array called outprimes. INSTRUCTIONS: outPrimes contains all prime numbers about the lowerrange in ascending or- der while the sum of out Primes is less than the highest element of outEvens. Given the following: lowerrange = 2; upperrange= 20; [outevens, outprimes ] = FindPrimes (lowerrange, upperrange) [out Evens] = [2 4 8 10 14 16 20] We want our code to produce: out Primes [2 3 5 7]
Expert Answer:
Answer rating: 100% (QA)
Solution Here is the code function outEvens outPrimes FindPrimeslowerRange upperRange outEvens ... View the full answer
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date:
Students also viewed these programming questions
-
Devaney Co.s stock price is $40 per share, and its expected year-end dividend is $1.60 a share (D1 = $1.60). The stocks required return is 9.00%, and the dividend is expected to grow at a constant...
-
9. Determine the next three terms of the sequence. Explain your reasoning. (4 marks) a. 1 2 3 4 2'5'8'11 b. 1, -8, 27, -64, 125......... 10. A population of rabbits if left unchecked will triple...
-
Suppose the graph represents the sales of goods of a company from the year 2000 to 2008. a) Find the average rate of change from x = 1 to x = 4 and interpret. b) Find the average rate of change from...
-
Suppose a company has the Cobb-Douglas production function z = 100 0.75 y0.25 where x is the number of units of labor, y is the number of units of capital, and z is the units of production. Suppose...
-
Use lHospitals rule where applicable to find each limit. lim et x0 2x + 9x - 11x
-
Beth worked as a lifeguard for several summers while attending college. During the course of her employment, she and other female lifeguards were subject to uninvited and offensive touching by their...
-
The Theater Arts Guild of Chicago (TAG-C) employs five people in its Publication Department. These people lay out pages for pamphlets, brochures, and other publications for the TAG-C productions. The...
-
Question 2) Suppose there were an alternative replacement machine that could do the same job as the new stamping machine under your consideration in Question 1. The alternate choice offers the...
-
On January 1, the Wiek Company contracted with its president, T. Mae, to make a single deposit immediately to establish a fund with a trustee that pays Mae $40,000 per year for each of the three...
-
i. ii. 3. A slider in a machine moves along a fixed straight rod, its distance x c.m.. along the rod is given below for various values of the time t seconds. Evaluate the velocity of the slider and...
-
Forever Old Thrift Shop is considering renovating the entire store shopping area to attract more customers. The cost of the renovation is $10,000. The net cash flows resulting from the investment are...
-
100 3. Provide an example of two different functions f: E E and f2: E E such that both f and 2 are not isometries but their linear combination 43f + 19f2 is an isometry. In your example explain why f...
-
Note: R Is The Last Digit Of The Student Registration Number. (Second Last Digit, If The Last Digit Is Zero) 1) (20) Value Of The Portfolio Today Is $100. Annual Mean U = 20%, Variance O2 = 10%. Time...
-
Highlight the key issues that will deliver a positive coverage decision for your product, showing value over the competition. Have you planned to collect economic data for analysis in your clinical...
-
7) A reaction is first order in the concentration of reactant. It took 102 seconds for the reactant to decrease of its original value. How many minutes will it take for 97% to react?
-
Whispering Winds, Inc. has budgeted direct materials purchases of $420,000 in March and $505,000 in April. The company policy is to pay for 60% of purchases in the month of purchase and the remaining...
-
Subtract the polynomials. (-x+x-5) - (x-x + 5)
-
If it takes 2 seconds to solve a two-dimensional, diffusion equation 2 T = 0 with 20 nodes in x and y using banded Gauss elimination, how long does it take for 40 nodes in x and y?
-
In this problem, you will use your knowledge of solving systems of nonlinear equations and continuation methods to determine both the composition and the temperature distribution in an ideal staged...
-
Write the determinant of the following 33 matrix A as a sum of the determinants of 2 2 matrices using co-factor expansion on the third row (i = 3): A = 6 3 5 215 23 2
-
You are to enter up the necessary accounts for the month of October from the following information relating to a small printing firm. Then balance-off the accounts and extract a trial balance as at...
-
What would have been the balance on the account of C. De Freitas in MC17 on 19 May 2017? (A) A debit balance of 265 (B) A credit balance of 95 (C) A credit balance of 445 (D) A credit balance of 265
-
Enter the following transactions of an antiques shop in the accounts and extract a trial balance as at 31 March 2017. 2017 March 1 Started in business with 8,000 in the bank. 2 Bought goods on time...
Study smarter with the SolutionInn App