Find max of matrix without using built in function.
이전 댓글 표시
I want to find the "max(a)" without actually using the built in "max" function.
댓글 수: 2
Roland
2011년 5월 4일
Sean de Wolski
2011년 5월 4일
We won't do your homework for you. What have you tried so far.
채택된 답변
추가 답변 (2개)
Sean de Wolski
2011년 5월 4일
the_max = -min(-(a(:)))
Adrien Leygue
2011년 5월 4일
0 개 추천
The following code will extract the minimum over each column. No loop no max no min and of course not optimal. Feel free to adapt it to other purposes:
S = A((repmat(eye(size(A,1)),[1 size(A,1)]) *(kron(A,ones(size(A,1),1)) < kron(ones(size(A,1),1),A)))==0)'
A.
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!