More efficient alternative to find()
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello,
I am working on some simulation data and I would like to find the maximum element in each randomly generated vector which has no inherent pattern. Is there any more efficient alternative to the find() function in this case since Profiler says that find() is taking up a significant proportion of the compile time.
Many thanks.
댓글 수: 0
채택된 답변
John D'Errico
2023년 8월 4일
편집: John D'Errico
2023년 8월 4일
Why does max not do what you want? There are TWO returns from max.
X = randi(100,[1,10])
[xmax,maxloc] = max(X)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!