Question: matlab problem Extra Credit: Write code to produce a prime factorization of the number 7418880. A prime factorization contains a set of prime numbers, in
Extra Credit: Write code to produce a prime factorization of the number 7418880. A prime factorization contains a set of prime numbers, in increasi product of those prime numbers is the desired number (here, 7418880). The MATLAB function factor produces prime factorizations in exactly the format required; DO NOT USE THIS FUNCTION IN YOUR CODE, but feel free to use it to check your work. Your code should be flexible enough to prime-factorize other numbers that are not prime (e.g. replacing 7418880 with 4, whose prime factors are [22], or 108, whose prime factors are (2 2 3 3 3]). The function primes produces all prime numbers less than or equal to its input, and could be very helpful for solving this problem. Store your answer as a row vector called pf (2 points). HINT: To check if a number x divides evenly into another number v. use the conditional y/x-floor (y/x), which returns true only if y/x is a whole number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
