Logical Indexing with Condition Involving Functions
조회 수: 5 (최근 30일)
이전 댓글 표시
Suppose I created a function F, and I want to find all elements a in an array A such that F(a) is some value of the function. Is there any way to do this with logical indexing (or some other method)? I tried to use idx = (F(A) == 1), but it has been giving me error messages about different numbers of elements. Thanks in advance!
댓글 수: 2
Stephen23
2021년 5월 5일
"but it has been giving me error messages about different numbers of elements"
Please show the complete error message. This means all of the red text.
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!