How to create a vector using for-end loops that contains odd integers between 1 and 100?
조회 수: 1 (최근 30일)
이전 댓글 표시
Vector Q contains the odd integer between 1 and 100
댓글 수: 0
채택된 답변
추가 답변 (1개)
Phyo Pie
2020년 10월 22일
편집: Phyo Pie
2020년 10월 22일
Q = [1:2:99]
EDITED!!
1:2:99 is a vector already. The square brackets joins all elements to a vector. It does not change anything on the data, but needs more time.
Q = 1:2:99
댓글 수: 1
Stephen23
2020년 10월 22일
The square brackets are superfluous (you are not concatenating anything), get rid of them.
참고 항목
카테고리
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!