|
On 06/01/11 7:49 AM, Hermano Cappa wrote:
> How can you generate a logspaced vector but with the fine spacing of
> your vector at the end instead of at the begin?
>
> example:
> logspace(0.1,1,5)
>
> result:
> 1.2589 2.1135 3.5481 5.9566 10.0000
>
> The spacing between the first and second number is small and increases
> to the fifth number. But I want the opposite: A great spacing between
> the first and second number and finer to the fifth number.
There are multiple ways of doing that, of course. You won't be able to
do it as a pure geometric progression. Here's a version that does it as
a geometric progression on the differences:
rlogspace = @(a,b,n) 10^b+1-(10^b+1-10^a).^((n-1:-1:0)./(n-1));
|