Find position
조회 수: 5 (최근 30일)
이전 댓글 표시
How can I find from an input vector the position of the number that deviates the most from the average of the values of the vector.
댓글 수: 0
답변 (2개)
Image Analyst
2011년 12월 23일
averageOfVector = mean(vector);
Now, assuming the input vector, inputVector, has positions in it, what do those positions deviate FROM by more than averageOfVector? Is there a third vector, like
deviations = inputVector - thirdVector;
firstPosition = find(deviations > averageOfVector , 1, 'First');
댓글 수: 2
Image Analyst
2011년 12월 23일
Sounds like a class assignment. Hint: use the max() function and look at both return arguments. Also look at the abs() function.
Walter Roberson
2011년 12월 23일
You want to know the location of the MAXimum ABSolute difference between x and its MEAN ?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 NaNs에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!