> But you can get what you want simply by > rounding the slider value in the callback function.
I know. That is what I had to do.
>You want two levels > of granularity and you can have them. > > I want three levels of granularity
No problem. There is a trivial solution to this.
Add a new option to allow user to specify either the "2 levels" or the "3 levels". Make the default to be the "3 levels" so it works as it does now.
This way the UIcontrol will be backward compatible. Old code will work on new versions as is when this option is missing.
This way, a user does not have to do the rounding as this is something that should be done inside the UI control based on the minor step.
This way, you can have your 3 levels, and I can have my 2 levels.
But this is not a big deal for me actually, I do not do much Matlab GUI any more. I was just playing around with some program and noticed this strange slider result. I just like to complain when I see something not right. I can't help it :)