Eliminating a for loop for faster computation
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
HI, FInd below part of my code .Is it possible to substitute the for loop so that it is faster and takes less computation?
time_durations=zeros(length(out),1)';
for k=1:length(out)
time_durations(k)=minutes(time_select_20000(out(k,3))-time_select_20000(out(k,2)));
end
0 件のコメント
回答 (1 件)
Walter Roberson
2015 年 6 月 26 日
Have you tried
minutes(time_select_20000(out(:,3))-time_select_20000(out(:,2)))
with no loop?
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!