Is it possible to rotate a slider 180 degrees?
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (1)
function CreateSlider
fig = figure;
Slider = uicontrol(fig,'Style','Slider',...
'Max','100','Min','0','Value','0',...
'SliderStep',[1 1]/100,...
'Position',[20 100 20 50],...
'Callback', @Slider);
end
end
function @Slider(hObj,event) SliderVal = get(hObj,'Value'); NewSliderVal = 100 - SliderVal; disp('NewSliderVal); end
% The slider will still increase when you click up, however NewSliderVal will decrease, and what ever you were using your SliderVal for, just sub in NewSliderVal instead
1 Commento
Silvia
il 30 Mag 2013
Categorie
Scopri di più su Camera Views in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!