compare integer values
Mostra commenti meno recenti
How i can compare between each element in specific matrix and constant value as 0.5 and then take action if the result true .
Risposta accettata
Più risposte (1)
Honglei Chen
il 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))
Categorie
Scopri di più su Creating and Concatenating Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!