# Logarithmic Scale Slider for GUI MATLAB

I'm having trouble to create a slider for GUI in MATLAB. I really want a slider that ranges from 10^-1 to 10^-5. But that has intervals by factors of 0.1. So the the slider would have a logarithmic scale. Anyone know how to solve this problem?

I'm not really sure if I understood you right. If you want to make logarithmic scale from linear scale:

Definition of logarithm:

So if you need to slider from 10^-1 to 10^-5 you want to get from your slider some value and convert it properly. I suggest to set your min and max to 1 and 5 (or -5 and -1) and after every slider callback or just use of slider value convert using this equation:

```y = 10^(-x)
```

Where y is your wanted value and x is a value in a slider. In a code it should be similar to this:

```logValue = 10^(-get(hObject,'Value'));
set(handles.text2,'string',logValue);
```

Check this method by putting in your gui some kind of text box that would show you your y.

But if you want to make linear scale from logarithmic:

``` y = log(x)
```