What is the result of the following command? x = 5 : -2 : 1
조회 수: 5 (최근 30일)
이전 댓글 표시
답변 (2개)
Yazan
2021년 7월 1일
Your command has the form: x = x1:stp:x2, where x1 is the starting value, x2 is the end value, and stp is the step. Applying that to your example, x will go from 5 to 1 with a step of -2. Therefore, x = [5, 3, 1].
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!