Afficher commentaires plus anciens
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.
Réponses (2)
Image Analyst
le 23 Déc 2011
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 commentaires
Paul
le 23 Déc 2011
Image Analyst
le 23 Déc 2011
Sounds like a class assignment. Hint: use the max() function and look at both return arguments. Also look at the abs() function.
Walter Roberson
le 23 Déc 2011
0 votes
You want to know the location of the MAXimum ABSolute difference between x and its MEAN ?
Catégories
En savoir plus sur Simulink 3D Animation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!