How to create a vector of single numbers

7 views (last 30 days)
if I have a vector A=[1:1:550],how do I create a tble of the single numbers?for example [1,3,5,7,...,550]

Accepted Answer

KSSV
KSSV on 24 Apr 2020
Are you looking for
B = single(1:2:550)
  2 Comments
Eralnto Chaintini
Eralnto Chaintini on 24 Apr 2020
its for my homework,the exercise asked me to create a table from 1 to 550 and then asked me to create another table from the singles,will this solution be acceptable from the teacher,cause I think it's a function
KSSV
KSSV on 24 Apr 2020
A = 1:550 ;
% Method 1
iwant = A(1:2:end) ;
% method 2
iwant = 1:2:550 ;

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!