필터 지우기
필터 지우기

how to find maximum alement

조회 수: 1 (최근 30일)
aya qassim
aya qassim 2018년 12월 25일
댓글: aya qassim 2018년 12월 25일
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
aya qassim
aya qassim 2018년 12월 25일
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));

댓글을 달려면 로그인하십시오.

답변 (1개)

madhan ravi
madhan ravi 2018년 12월 25일
  댓글 수: 7
aya qassim
aya qassim 2018년 12월 25일
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 2018년 12월 25일
편집: aya qassim 2018년 12월 25일
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);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by