How to find the maximum element among the minimum elements in the columns in matrix m:n? With using loops.
조회 수: 1 (최근 30일)
이전 댓글 표시
It seemed simple from the beginning, but I got confused. Can anyone show a script that will do this?
댓글 수: 2
답변 (1개)
Guillaume
2020년 3월 25일
There's never any need for a loop for things like that. Loops usually complicate the code in matlab.
maxofcolmin = max(min(massive, [], 2)); %return the maximum of the minimum across the columns of massive
댓글 수: 2
Guillaume
2020년 3월 25일
Oh, it's some homework. I'm afraid you'll have to work it out yourself. It's not that hard. Keep track of your current minimum/maximum. Compare your element to that and if it is smaller/greater replace the current value.
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!