How to get the time when a variabile reaches the maximum value?
조회 수: 9 (최근 30일)
이전 댓글 표시
Hi everyone,
I would like to create a function where provides as output the period in which a variable reaches is maximum value.
For example :
x = [1 20 10 4 12]
How can I get as output in a function the sitting of 20? The function must return = 2
because in the second place there is the most high value.
I don't know where to start from.
댓글 수: 0
채택된 답변
madhan ravi
2020년 11월 8일
doc max
댓글 수: 3
Ameer Hamza
2020년 11월 9일
'doc max' is to see the documentation of max() function. If you open the documentation, you will see that it can be used like this
x = [1 20 10 4 12];
[~, idx] = max(x)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!