Maor Freeman
Maor Freeman

Reputation: 21

Matlab - How to create a vector with power sequence

How can I create a vector that is

2^1, 2^3, 2^5,..., 2^19

I tried to use V = logspace( log(2)/log(10) , 19*log(2)/log(10) , 10 ) but it didn't work.

Upvotes: 2

Views: 550

Answers (1)

Steffen
Steffen

Reputation: 2431

create the sequence of the exponents and then raise them:

2.^(1:2:19)

Upvotes: 7

Related Questions