Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started