Question: Matlab problem I need help with. Write a Matlab function with the name evoMat. This function takes one input arguments: mat and one output argument:
Matlab problem I need help with. Write a Matlab function with the name evoMat. This function takes one input arguments: mat and one output argument: mat2. The input argument mat is a matrix where its elements are all integers from 0 to 7. The output mat2 is also a matrix that has the same size as mat. The evoMat function evaluates the value of each element in the input matrix mat, except those in the edge of the matrix (first row, the last row, the first column and the last column), and change the element in the same location in mat2 according to the following rules: a. If an element in mat is 7, change element in the same location in mat2 to 0. b. If an element in mat is between 1 and 6, add 1 to this value and assign it to the element in the same location in mat2. c. If an element in mat is 0, AND at least one of its neighbors (above, below, left, right) is either 1 or 2, then the element in the same location of mat2 will be 1.

Write a Matlab function with the name evoMat. This function takes one input arguments: mat and one output argument: mat2. The input argument mat is a matrix where its elements are all integers from 0 to 7. The output mat2 is also a matrix that has the same size as mat The evoMat function evaluates the value of each element in the input matrix mat, except those in the edge of the matrix (first row, the last row, the first column and the last column), and change the element in the same location in mat2 according to the following rules If an element in mat is 7, change element in the same location in mat2 to 0 If an element in mat is between 1 and 6, add 1 to this value and assign it to the element in the same location in mat2 If an element in mat is 0, AND at least one of its neighbors (above, below, left, right) is either 1 or 2, then the element in the same location of mat2 will be 1. a. b. C. The elements located at the edge of mat2 have the same value as those in the same location in mat For example, if the input matrix to the function is: 0 0 5 10 0 2 360 07 040 The output will be: 0 1 6 2 0 03 470 00 0 50 Write a Matlab function with the name evoMat. This function takes one input arguments: mat and one output argument: mat2. The input argument mat is a matrix where its elements are all integers from 0 to 7. The output mat2 is also a matrix that has the same size as mat The evoMat function evaluates the value of each element in the input matrix mat, except those in the edge of the matrix (first row, the last row, the first column and the last column), and change the element in the same location in mat2 according to the following rules If an element in mat is 7, change element in the same location in mat2 to 0 If an element in mat is between 1 and 6, add 1 to this value and assign it to the element in the same location in mat2 If an element in mat is 0, AND at least one of its neighbors (above, below, left, right) is either 1 or 2, then the element in the same location of mat2 will be 1. a. b. C. The elements located at the edge of mat2 have the same value as those in the same location in mat For example, if the input matrix to the function is: 0 0 5 10 0 2 360 07 040 The output will be: 0 1 6 2 0 03 470 00 0 50
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
