The question is asking to find the smallest entryelementnumb

The question is asking to find the smallest entry/element/number in the matrix as well as its location in the original matrix, please don`t misunderstand.

Please reply ASAP because I need it before the next morning! THANKS!

4· (Coding Practice) Write a MATLAB function that takes a matrix A as input. and finds the minimum element from this matrix and its corresponding row index d column index. The function hea function [minele, row, col-findminele(A) and column index. The function header is: where the input A is a matrix, and the output minele is the minimum element in where the input A is a matrix, and the A, and the outputs row and col are the corresponding row and column indices of minele. (Note: you are NOT allowed to use the built-in MATLAB function min here

Solution

For a matrix

A(:,n) refer to the elements in all rows of column n of the matrix A.

A(n,:) refer to the elements in all the columns of row n of the matrix A.

A(:,m:n)refers to the elements in all the rows between columns m and n of the matrix A.

A(m:n,:) refers to the elements in all the elements between rows m and n of the matrix A.

A(m:n,p:q) refers to the elements in rows m through n and columns p through q.

Ex:1 . create a matrix A with 5 rows and 6 columns and create another column vector B from the elements in all the rows of column 3 in matrix A.

>> A=[1 3 5 7 9 11;2 4 6 8 10 12;3 6 9 12 15 18;4 8 12 16 20 24;5 10 15 20 25 30]

A = 1     3     5     7     9    11

2     4     6     8    10    12

3     6     9    12    15    18

4     8    12    16    20    24

5    10    15    20    25    30

>> A(3,2)% it shows that 3rd row 2nd column.

ans =     6

>> B=A(:,3) % it shows that all rows in third column.

B = 5

     6

     9

    12

    15

>> C=A(2,:) % it shows that all columns in second row.

C =     2     4     6     8    10    12

>> A(:,2:3)           % it shows that all rows in 2nd to 3rd columns

ans =

     3     5

     4     6

     6     9

     8    12

    10    15

>> A(2:3,:)% it shows that all columns with 2nd to third row.

ans =

     2     4     6     8    10    12

     3     6     9    12    15    18

The question is asking to find the smallest entry/element/number in the matrix as well as its location in the original matrix, please don`t misunderstand. Pleas
The question is asking to find the smallest entry/element/number in the matrix as well as its location in the original matrix, please don`t misunderstand. Pleas

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site