Filter löschen
Filter löschen

how to find maximum alement

1 Ansicht (letzte 30 Tage)
aya qassim
aya qassim am 25 Dez. 2018
Kommentiert: aya qassim am 25 Dez. 2018
There is a matrix (nXm )
we should write a code that gives the maximum element in the matrix.
it is eligible to use : sort, max, min , for, if ,while or any loops .
  1 Kommentar
aya qassim
aya qassim am 25 Dez. 2018
I have started the solution but did not know how to continue
any help...
a=size(M);
b=M(1:end);
c=repmat(a,length(a),1);
d=repmat(a',1,length(a));
e=(c-d);
f=M(e>=0);
h=(sum(f));

Melden Sie sich an, um zu kommentieren.

Antworten (1)

madhan ravi
madhan ravi am 25 Dez. 2018
max(matrix(:))
  7 Kommentare
aya qassim
aya qassim am 25 Dez. 2018
it is a homework but I do not have any idea how to start the solution, I have tried some ways but they did not work.
aya qassim
aya qassim am 25 Dez. 2018
Bearbeitet: aya qassim am 25 Dez. 2018
I have started the solution in this way, can you help me to continue..
M= is the matrix that we put.
a=size(M);
b=M(1:end);
c=repmat(a,length(a),1);
d=repmat(a',1,length(a));
e=(c-d);
f=(e>=0);
h=sum(f);

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by