Skip to main content
1-Visitor
Question

Evaluate values in two Matrices

How do I evaluate each element in two matrices of equal sizes (4 rows x 5 columns) and then return the maximum value into a new matrix? I want to evaluate each element with the corresponding element on the second matrix and produce a new matrix. Thank you in advance for your help with this!

16 replies

Werner_E
25-Diamond I

The attached file should help.

Translate
1-Visitor

Following on from Werner's example the code could be contained in a simple nested for loop program.

Translate
Werner_E
25-Diamond I

So if we go into programming, lets make it complete and create a utility function.

Translate
1-Visitor

Nicely done

Translate