Logical Indexing with Condition Involving Functions
6 次查看(过去 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!