Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Nested for loops help!
조회 수: 2 (최근 30일)
이전 댓글 표시
If i have
m1(n,1)=(m2(n,1)+((m3(n,1))*p));
Where m1 m2 and m3 are all arrays. if i wanted the range of n=1:42, and the range of p=1:31, how could i tell matlab to calculate l=1:31 for every different value of n?
댓글 수: 0
답변 (2개)
BAN
2015년 9월 24일
편집: James Tursa
2015년 9월 24일
Try using this:
for n = 1:42
for p=1:31
m1(n,1)=(m2(n,1)+((m3(n,1))*p));
end
end
Here, for every value of n, that equation will be executed 31 times.
Hope it helps !!
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!