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!