compare integer values
显示 更早的评论
How i can compare between each element in specific matrix and constant value as 0.5 and then take action if the result true .
采纳的回答
更多回答(1 个)
Honglei Chen
2012-2-15
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))
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!