Question: Please show the code for the following problems in beginner MATLAB code. Please be sure to include well detailed comments so that I may be

Please show the code for the following problems in beginner MATLAB code. Please be sure to include well detailed comments so that I may be able to understand all functions and processes. Thanks in advance. Please read instructions carefully and make sure that programs run properly.

Please show the code for the following problems in beginner MATLAB code.

Problems In this lab, we will use MATLAB to implement the Greatest Common Divisor (GCD) and the Least Common Multiple (LCM). Please carefully read and follow the descriptions of each problem. 1. Prime Factorization of a Number (25 points Write a function that takes as a parameter a positive integer and returns a list (array or vector in MATLAB) of the prime factors of the given integer. For example, if the parameter is 20, you should return 2 2 5. 2. GCD (25 points) Write a function that takes as a parameter a list (array or vector in MATLAB) of 2 or more positive integers. Return the GCD of all elements in the list. For example, the GCD of 10 20 30 is 10 Note: Implement the Euclidean algorithm function for computing the greatest common divi- sor of two integers as explained in CSC 1500 class note. Call this function EuclidGCD which is called in the function GCD 3. LCM (25 Points) Write a function that takes as a parameter a list (array or vector in MATLAB) of 2 or more positive integers. Return the LCM of all elements in the list. For example, the LCM of 10 20 30 is 60 4. Functions Tester (25 points) Write a function that tests the above functions by asking the user for input and displaying the output to screen. Your function should display the following menu: 1) Find the prime factorization of a number 2) Find the GCD of a series of numbers 3) Find the LCM of a series of numbers 4) Quit Your function should continuously display the menu until the quit option is selected

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!