Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions

Question

We cant wait their decision much longer.

Answered: 1 week ago

Question

LO27.6 List and explain some limitations of the GDP measure.

Answered: 1 week ago