compare integer values
Afficher commentaires plus anciens
How i can compare between each element in specific matrix and constant value as 0.5 and then take action if the result true .
Réponse acceptée
Plus de réponses (1)
Honglei Chen
le 15 Fév 2012
Say you have the matrix A, and you have a function foo contains the operation you'd like to apply to elements of A if they equal to 0.5, you can do
A(A==0.5) = arrayfun(@foo,A(A==0.5))
Catégories
En savoir plus sur Creating and Concatenating Matrices 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!