Concept explainers
Write a user-defined function that determines if a number is a prime number. Name the function pr=Trueprime (m), where the input arguments m is a positive integer and the output argument pr is 1 if m is a prime number and 0 if m is not a prime number. Do not use MATLAWS built-in
(a) Use the function with 733, 2001, and 107.5.
(b) Write a MATLAB program in a script file that makes use of Trueprime and finds the smallest prime number that remains a prime number when added to its reverse (37 is the reverse of 73).
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
MATLAB: An Introduction with Applications, 6th Edition: An Introduction with Applications
- Create a function in which the domain is x2 .arrow_forwardSuppose that A = and B = for some real numbers x and y. Find 9 у all ordered pairs (x, y) such that AB = BA. (Enter your answer as a list of ordered pairs; for example, (1,2), (3,4), (5,6) .) Answer: (0,3),(0,-3),(0,9),(1,0)arrow_forwardWhich one of the following functions has a range of all real numbers? O f (2) = VT O g (æ) = -V O h(x) = VT O j(x) = V - 10 English Support I Schoology Blog O Type here to search 69 10arrow_forward
- Explain why is it that when you compose a function and its inverse, the result is the same as the input argument into the function. Please help thank you !arrow_forwardQ/ Write a matlab program to find the value of F,which : 3A-2A+1 if A>4 F= 2A?+3 if A =4 2A? if A<4 The value of A=5arrow_forwardWhich statement regarding functions is true? O Each input results in exactly 1 output. O Each input results in 2 outputs. O Each input results in between 1 and 5 outputs. O Each input results in infinitely many outputs.arrow_forward
- Find all of the zeros in the functionarrow_forwardConsider a function machine that accepts inputs as ordered pairs. Suppose the components of the ordered pairs are positive real numbers and the first component is the length of a rectangle and the second is its width. The machine computes the perimeter (the distance around a figure) of the rectangle. Thus, for a rectangle whose length, L, is 3 and whose width, W, is 2, the input is (3,2) and the output is 2.3+2.2, or 10. Complete parts (a) through (c) below. L, W) Y O A. {(0,7), (1,6), (2,5), (3,4), (4,3), (5,2), (6,1), (7,0)) O B. ((0,7), (1,6), (2,5), (3,4)} O C. {(1,6), (2,5), (3,4), (4,3), (5,2), (6,1)) O D. {(1,6), (2,5), (3,4)} c. What is the domain and range of the function? 2L + 2W a. For each of the following inputs, find the corresponding output: (1,9), (7,3), (3,7), (√5,√5). The output for (1,9) is The output for (7,3) is The output for (3,7) is The output for (√5,√5) is b. Find the set of all inputs for which the output is 14. O A. The domain of the function is R* XR* and…arrow_forwardConsider a function machine that accepts inputs as ordered pairs. Suppose the components of the ordered pairs are positive real numbers and the first component is the length of a rectangle and the second is its width. The machine computes the perimeter (the distance around a figure) of the rectangle. Thus, for a rectangle whose length, L, is 3 and whose width, W, is 2, the input is (3,2) and the output is 2.3 +2.2, or 10. Complete parts (a) through (c) below. (L, W) A. {(0,9), (1,8), (2,7), (3,6), (4,5)} B. {(1,8), (2,7), (3,6), (4,5), (5,4), (6,3), (7,2), (8,1)} C. {(1,8), (2,7), (3,6), (4,5)} D. {(0,9), (1,8), (2,7), (3,6), (4,5), (5,4), (6,3), (7,2), (8,1), (9,0)} c. What is the domain and range of the function? 2L + 2W a. For each of the following inputs, find the corresponding output: (1,9), (7,3), (3,7), (√5,√5). The output for (1,9) is The output for (7,3) is The output for (3,7) is The output for (√5,√5) is b. Find the set of all inputs for which the output is 18. O A. The…arrow_forward
- Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:CengageCollege Algebra (MindTap Course List)AlgebraISBN:9781305652231Author:R. David Gustafson, Jeff HughesPublisher:Cengage LearningAlgebra: Structure And Method, Book 1AlgebraISBN:9780395977224Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. ColePublisher:McDougal Littell
- Big Ideas Math A Bridge To Success Algebra 1: Stu...AlgebraISBN:9781680331141Author:HOUGHTON MIFFLIN HARCOURTPublisher:Houghton Mifflin HarcourtTrigonometry (MindTap Course List)TrigonometryISBN:9781337278461Author:Ron LarsonPublisher:Cengage Learning