compare integer values
Mostrar comentarios más antiguos
How i can compare between each element in specific matrix and constant value as 0.5 and then take action if the result true .
Respuesta aceptada
Más respuestas (1)
Honglei Chen
el 15 de Feb. de 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))
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!