MATLAB: Is it possible to rotate a slider 180 degrees

vertical slider top-down

Hello,
I have a vertical slider, is it possible to rotate it 180 degrees?. The problem is that when I move the slider from top to down the value decreases and I would need the value increases when I move the slider from top to down.
Thank you
Silvia

Best Answer

This is easy, when you consider the different values inside the callback:
function ExampleSlider
sliderH = uicontrol('Style', 'slider', 'position', [10, 10, 20, 100], ...
'Min', 0, 'Max', 1, 'Callback', @CB);
function CB(ObjH, EventData)
value = get(ObjH, 'Value');
disp(value)
Now 1 is written to the command window, if you drag the slider to the top, and 0 for the bottom. Now change the callback to:
function CB(ObjH, EventData)
value = 1 - get(ObjH, 'Value');
disp(value)
E voila, 0 appears for the top and 1 for the bottom. There is no need to rotate the slider, but changing the logic to interpret the slider position is enough.