# How to find whether an array is logarithmically spaced

7 views (last 30 days)

Show older comments

### Accepted Answer

Mathieu NOE
on 26 Nov 2021

well

if you have a criteria that works for lin spaced arrays (like checking that std(diff(y)) is always below a very low threshold)

you can easily covert a log speced array to a lin spaced array by taking the log of it

demo :

y_log = logspace(1,3,100);

% nb : y = 10 .^ linspace(d1, d2, n);

y_lin = log10(y_log); % conversion from log to lin spacing

check = std(diff(y_lin))

check = 2.1980e-16

### More Answers (0)

### See Also

### Community Treasure Hunt

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

Start Hunting!