Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please anwer question number 2 Every positive integer can be written (uniquely) as a product of prime factors. For example, see the table below. In
Please anwer question number 2
Every positive integer can be written (uniquely) as a product of prime factors. For example, see the table below. In the first column, several integers are expressed in standard mathematical notation as products of their respective prime factors. In the second column, that prime factorization has been re-structured as a matrix. Your job in this problem is to re-construct a positive integer if given its prime factorization (in matrix form as shown in the table above). Write a Matlab function called makeintf.m which takes a matrix (as structured in the table above) as input, and produces a positive integer as output. Use a for loop in your code to accomplish this task. The function specifications and some sample function calls are shown in the tables below. input parameter pfmat a matrix representing the prime factorization of an integer output parameter theint an integer (constructed from the prime factorization stored in pfmat) sample function calls makeintf (PF1) produces the value 144 makeintf (PF2) produces the value 30870 makeintf (PF3) produces the value 19827925 Repeat problem 1, but this time use a while loop instead of a for loop, and call the resulting function makeintW.mStep 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