What is the meaning of command for(x:x1:x2) ?
조회 수: 7 (최근 30일)
이전 댓글 표시
What is the meaning of command that is (for (x:x1:x2)) ?
댓글 수: 0
답변 (1개)
Ameer Hamza
2020년 9월 23일
편집: Ameer Hamza
2020년 9월 23일
The correct is
for i = x:x1:x2 % any variable name can be used in place of i
% The variable i takes value from vector x:x1:x2 in each iteration
end
In each iteration, MATLAB takes values from vector x:x1:x2 and assigns it to the variable i. To understand what (x:x1:x2) means, read here: https://www.mathworks.com/help/matlab/ref/colon.html
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!