vectorize without using loop

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.

 Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 18 Mär. 2013

0 Stimmen

out=X(indtrn,indtrn)

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by