Question: In MATLAB Q.1 Write a function Maxindex that will take a matrix as input, and its output is the indices of the maximum element of

In MATLAB

Q.1 Write a function Maxindex that will take a matrix as input, and its output is the indices of the maximum element of the matrix. So, if

A = [1 2 -3

-4 5 6]

Then Maxindex (A) should be [2 3], which are the indices of 6, which is the maximum.

Q.2 Write a function Diagmultiply that will take a square matrix as input, and its output is the product of the diagonal elements of the matrix. So, if

A = [1 2 -3

-4 5 6

0 -1 8]

Then Diagmultiply (A) should be 40, which is the product of 1, 5 and 8.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!