compare integer values
Ältere Kommentare anzeigen
How i can compare between each element in specific matrix and constant value as 0.5 and then take action if the result true .
Akzeptierte Antwort
Weitere Antworten (1)
Honglei Chen
am 15 Feb. 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))
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!