Question: Question 4. [15 Marks] Write a MATLAB program that receives a matrix with positive integer numbers from a user (we assume the user just enters
![Question 4. [15 Marks] Write a MATLAB program that receives a](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f967e6299e6_09366f967e5a4203.jpg)
Question 4. [15 Marks] Write a MATLAB program that receives a matrix with positive integer numbers from a user (we assume the user just enters positive integer numbers, so no need to further check) and then calculates and outputs the factorial of summation of even numbers (existing in the matrix) in a form of a formatted message as follows: The factorial of summation of even elements in the given matrix is xx. Your code should consider situations that there is no even element or just one even element in the matrix. In these cases, the MATLAB code should output one of the corresponding messages indicated below: There is no even element in this matrix. There is only one even element in this matrix and its factorial is xx. You should write your code in a systematic programming form. Hint: For example, if the matrix entered is A= [2 1;3 2] the factorial of summation of even elements is 24. Note: Your solution should be comprehensive and can be used for any matrix dimension. You should not use MATLAB built-in function factoriall for this question. Also, you should implement the factorial calculation within the same script not in a separate function file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
