How to run multiple for loops simulatenously in matlab

조회 수: 3 (최근 30일)
Swathy
Swathy 2015년 11월 28일
답변: Walter Roberson 2015년 11월 28일
In my project plot a moving point with position and velocity from one point to another.

답변 (2개)

Image Analyst
Image Analyst 2015년 11월 28일
To get loops to run simultaneously, you'd need the Parallel Computing Toolbox http://www.mathworks.com/products/parallel-computing/ I don't have that toolbox so I can't help with it, but it will have some example code for it.

Walter Roberson
Walter Roberson 2015년 11월 28일
Possibly you mean something like this:
firstlist = [2 4 8 16 9 3];
secondlist = [5 11 4 4 7 11];
for K = 1 : length(firstlist)
first = firstlist(K);
second = secondlist(K);
... some calculation with both variables
end
This uses corresponding values of the two lists, 2 with 5, 4 with 11, and so on.

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by