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!