Basic loop syntax in MATLAB: for k=1:n
조회 수: 18 (최근 30일)
이전 댓글 표시
What does it mean
for k=1:n
댓글 수: 2
Walter Roberson
2021년 3월 29일
It is as described in the responses rom Sean and I, with n being 3.
답변 (2개)
Sean de Wolski
2011년 1월 28일
it means that everything between that line
k = 1:n
and
end
will be evaluated with k = every integer between 1 and n.
doc for
for more information
댓글 수: 0
Walter Roberson
2011년 1월 28일
(Adjusting Sean's answer):
it means that everything between that line
k = 1:n
and
end
will be evaluated with k = every integer starting at 1 and not exceeding n; no iterations will be done at all if n < 1
doc for
for more information
댓글 수: 4
Matt Fig
2011년 1월 28일
Jan, how do you remember these things! There are obviously no angry armadillos bouncing around in your head.
Walter Roberson
2021년 3월 29일
(The link mentioned by Jan moved to https://groups.google.com/g/comp.soft-sys.matlab/c/VHVkpxJoKMA/m/lMVgXwAYV-wJ )
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!