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!