필터 지우기
필터 지우기

Ho to find a position

조회 수: 2 (최근 30일)
Sukumar Palo
Sukumar Palo 2011년 2월 24일
i have to find out the value before max in the array. like
a=[1 2 3 2 1 3 2 1 3 4 3 2 2 1 6 1 2 3 3 4 4 5 5 5 3 4 2 2 4]
size of a=29
max in a=6 in 15th position
what i have to do is
write a function that will return the 12th position in the array by evaluating one by one data points in the array before the max occurs.
  댓글 수: 1
Jan
Jan 2011년 2월 24일
Is there a difference to your question called "how to do"? Instead of asking a question twice here, and in CSSM also, it would be better to react to the answers until you found the solution such that you can accept an answer finally.

댓글을 달려면 로그인하십시오.

답변 (1개)

Andreas Goser
Andreas Goser 2011년 2월 24일
[c in]=max(a) % returns position of maximum
a(in-1) % value before the maximum - to be modfied for your needs

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by