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

채택된 답변

Walter Roberson
Walter Roberson 2016년 10월 6일
Hint: for location Index, the value is (2*Index - 1)

추가 답변 (1개)

Phyo Pie
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

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by