MATLAB: Logspace boundary of 2*10^b

logspace logarithmically spaced vector

I want to create logarithmically spaced vector of n points between 10^a and 2*10^b , can i use logspace somehow for this? I don't know how to set this 2*10^b boundary. Maybe some other function?

Best Answer

2*10^b is equal to (10^log10(2))*10^b which is equal to 10^(b+log10(2)), so
n = 20;
a = 3;
b = 4;
logspace(a,b+log10(2),n)
gives 20 equally-spaced points from 10^3 and 2*10^4.