How to create a vector using for-end loops that contains odd integers between 1 and 100?
3 views (last 30 days)
Show older comments
Vector Q contains the odd integer between 1 and 100
0 Comments
Accepted Answer
More Answers (1)
Phyo Pie
on 22 Oct 2020
Edited: Phyo Pie
on 22 Oct 2020
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 Comment
Stephen23
on 22 Oct 2020
The square brackets are superfluous (you are not concatenating anything), get rid of them.
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!