Clear Filters
Clear Filters

How to add Slider properties with in the app designer?

28 views (last 30 days)
I have created GUI, in that i wanted to write conditions based on the Slider min & slider Max values. But I tried to create
'Position',[0.8 0.1 0.1 0.8],...
'BackgroundColor',[1 1 1],...
I am getting errors with. Can any one help me with this?

Answers (1)

Simon Chan
Simon Chan on 15 Jun 2022
It uses Limits rather than Min, Max to define the limits.
Lavanya on 15 Jun 2022
Yes, but I wanted to write condition for another button that should run in limits.
with the max and min, I am able to write a condition.
sliderValue = get(h.slider, 'Value');
% if slider value is less than the maximum, then we can increment
if sliderValue < (get(h.slider, 'Max'))
.........%code for execution
How can i define limits for this condition
Simon Chan
Simon Chan on 15 Jun 2022
sliderLimit = get(h.slider,'Limits') if sliderValue < sliderLimit(2) ………………

Sign in to comment.


Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!