integer operands are required for colon operator when used as index
2 次查看(过去 30 天)
显示 更早的评论
Why do I get the warning "integer operands are required for colon operator when used as index" in the final line is this code:
vector_examined = rand(items,1); criteria = vector_examined < value; passes = find(criteria);
2 个评论
the cyclist
2012-1-24
Would it be possible for you to post some self-contained code that will produce the error (without us having to guess what "items" and "value" look like)? For example, if I choose items=5 and value=0.2, your code runs just fine for me.
Walter Roberson
2012-1-24
I do not see anything obvious. Is it possible that you typed this line in for us, rather than using copy-and-paste? Could you also show us the previous line?
回答(0 个)
另请参阅
类别
在 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!