Question: 2 Prime factorization Write a function to find the prime factors of an input number, not 0 . The function should take an integer and
Prime factorization
Write a function to find the prime factors of an input number, not The function
should take an integer and output a vector whose entries are the prime factors of the
input. These entries can be repeated ie if you multiply all the entries you should get the
original number. If the input equals to print an error and output the empty vector
If the input equals to output just the number Do not use the Matlab function
factor to solve this problem.
Then in the main script, test the function with the following inputs:
Hint: You may want to reuse the function isprime from Oct notes to help determine
the output for prime numbers. If you decide to use it make sure to make a function file
for isprime and include it with your folder and submission this will increase the total
of files to be submitted to : function files and main script
Please solve in Mathlab with explanation and comment each line and screetshot of working code plus make it easy to copy.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
