From: Rob Ing on
Hi,

Ive made a GUI with a slider bar. I really dont understand one of my slider bars because it misses random numbers out. If i move the slider up and down, its the same numbers that are missed out but there is no logic to it.

The step values are, x resolution is 0.001 and the y resolution is 0.5.
Max value is 150 and the min value is 0.

When i collect the value this is the line that i use.

GridSize = round(get(handles.grid_slider2,'value'))

Because i am using it for a grid, the numbers need to be whole and this is the reason why i have rounded the number.

Any help will be great thanks!

Rob
From: Rob Ing on
"Rob Ing" <ringham3(a)hotmail.com> wrote in message <ho3kie$f56$1(a)fred.mathworks.com>...
> Hi,
>
> Ive made a GUI with a slider bar. I really dont understand one of my slider bars because it misses random numbers out. If i move the slider up and down, its the same numbers that are missed out but there is no logic to it.
>
> The step values are, x resolution is 0.001 and the y resolution is 0.5.
> Max value is 150 and the min value is 0.
>
> When i collect the value this is the line that i use.
>
> GridSize = round(get(handles.grid_slider2,'value'))
>
> Because i am using it for a grid, the numbers need to be whole and this is the reason why i have rounded the number.
>
> Any help will be great thanks!
>
> Rob

Problem solved. The resolution was wrong. To calculate the step value.
1/(max value - min value) = step resolution.