Clear Filters
Clear Filters

vectorize without using loop

1 view (last 30 days)
Eric
Eric on 18 Mar 2013
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.

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 18 Mar 2013
out=X(indtrn,indtrn)

More Answers (0)

Community Treasure Hunt

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

Start Hunting!