Write a C function that, given a square matrix of floats, finds the diagonal with maximum average value. The function should have the following prototype: float matrMaxDiaq(float M[DIM] [DIM], int n);...

This is not a graded question so please don't disregard it as if it is. Thank you in advance professor!Write a C function that, given a square matrix of floats, finds the diagonal with maximum average value. The function should have<br>the following prototype:<br>float matrMaxDiaq(float M[DIM] [DIM], int n);<br>where DIMİis the size of the matrix, and n (n <= DIM) İs the number of rows and columns that are actually used.<br>The function calculates the average value of each diagonal, and then returns the maximum of such values,<br>Example of execution:<br>1.0<br>2.0<br>3.0<br>4.0<br>5.0<br>1.0<br>2.0<br>3.0<br>4.0<br>5.0<br>2.0<br>2.0<br>2.0<br>2.0<br>-2.0<br>2.0<br>2.0<br>2.0<br>2.0<br>-2.0<br>50/1 5.0<br>1.1<br>2.2<br>3.3<br>-4.4<br>5.5<br>1.1<br>2.2<br>3.3<br>-4.4<br>5.5<br>2.0/2 1.0<br>2.2<br>2.2<br>-3.2<br>4.2<br>4.2<br>2.2<br>2.2<br>-3.2<br>4.2<br>4.2<br>10.5/3 3.5<br>1.8<br>-2.3<br>3.1<br>4.9<br>5.0<br>1.8<br>-2.3<br>3.1<br>4.9<br>5.0<br>3.8/4 0.95<br>15.5/5 = 3.1<br>F18-012%= 6.4/3%3<br>59/4= 1.475<br>Max diag average: 5.0<br>0.05<br>2.133<br>45.<br>

Extracted text: Write a C function that, given a square matrix of floats, finds the diagonal with maximum average value. The function should have the following prototype: float matrMaxDiaq(float M[DIM] [DIM], int n); where DIMİis the size of the matrix, and n (n <= dim)="" is="" the="" number="" of="" rows="" and="" columns="" that="" are="" actually="" used.="" the="" function="" calculates="" the="" average="" value="" of="" each="" diagonal,="" and="" then="" returns="" the="" maximum="" of="" such="" values,="" example="" of="" execution:="" 1.0="" 2.0="" 3.0="" 4.0="" 5.0="" 1.0="" 2.0="" 3.0="" 4.0="" 5.0="" 2.0="" 2.0="" 2.0="" 2.0="" -2.0="" 2.0="" 2.0="" 2.0="" 2.0="" -2.0="" 50/1="" 5.0="" 1.1="" 2.2="" 3.3="" -4.4="" 5.5="" 1.1="" 2.2="" 3.3="" -4.4="" 5.5="" 2.0/2="" 1.0="" 2.2="" 2.2="" -3.2="" 4.2="" 4.2="" 2.2="" 2.2="" -3.2="" 4.2="" 4.2="" 10.5/3="" 3.5="" 1.8="" -2.3="" 3.1="" 4.9="" 5.0="" 1.8="" -2.3="" 3.1="" 4.9="" 5.0="" 3.8/4="" 0.95="" 15.5/5="3.1" f18-012%="6.4/3%3" 59/4="1.475" max="" diag="" average:="" 5.0="" 0.05="" 2.133="">

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here