I believe there's way to vectorize the following code without using the loop
for i = 1:length(indtrn)
Xtrn(i, :) = X(indtrn(i), indtrn);
end
Can someone shed me some light? Thanks in advance.

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 18 日

0 投票

out=X(indtrn,indtrn)

1 件のコメント

Eric
Eric 2013 年 3 月 19 日
exactly. Thank you, Azzi.

サインインしてコメントする。

その他の回答 (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!

Translated by