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!