How to avoid for loop when indexing?
显示 更早的评论
Hello,
I have the following for loop, where pairs(500x10), is there to calculate cc without for loop?
for i=1:500
cc(i,:)=pairs(i,pairs(i,:));
end
4 个评论
Stephen23
2018-7-2
@Mantas Vaitonis: what is pairs2 ? What values do pair and pairs2 contain?
Mantas Vaitonis
2018-7-2
编辑:Mantas Vaitonis
2018-7-2
Stephen23
2018-7-2
@Mantas Vaitonis: given that pairs contains non-integer values, what do you expect
pairs(i,pairs(i,:));
to do?
Mantas Vaitonis
2018-7-2
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!