I've been told that I should avoid "for" loops in MatLab because they are generally less efficient. True? Is there a better way to write this?
for y=1:33
VKT_SC(y,:)=SC_Share(y,:).*Total_F_VKT(y)
end

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 1월 18일
편집: Azzi Abdelmalek 2014년 1월 18일

0 개 추천

VKT_SC=bsxfun(@times,SC_Share,Total_F_VKT)
or depending on the size of Total_F_VKT
VKT_SC=bsxfun(@times,SC_Share,Total_F_VKT')

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2014년 1월 18일

댓글:

2014년 1월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by