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.

 채택된 답변

John D'Errico
John D'Errico 2023년 8월 4일
편집: John D'Errico 2023년 8월 4일

0 개 추천

Why does max not do what you want? There are TWO returns from max.
X = randi(100,[1,10])
X = 1×10
56 1 14 16 99 73 73 55 89 95
[xmax,maxloc] = max(X)
xmax = 99
maxloc = 5

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

릴리스

R2021b

태그

질문:

2023년 8월 4일

댓글:

2023년 8월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by