How to add Slider properties with in the app designer?

13 ビュー (過去 30 日間)
Lavanya
Lavanya 2022 年 6 月 15 日
コメント済み: Simon Chan 2022 年 6 月 15 日
I have created GUI, in that i wanted to write conditions based on the Slider min & slider Max values. But I tried to create
app.slider=uicontrol('Parent',app.UIFigure...
'Units','Normalized',...
'Position',[0.8 0.1 0.1 0.8],...
'Style','Slider',...
'BackgroundColor',[1 1 1],...
'Min',1,'Max',N_images,'Value',1,...
'Callback',@app.SliderValueChanging);
I am getting errors with. Can any one help me with this?

回答 (1 件)

Simon Chan
Simon Chan 2022 年 6 月 15 日
It uses Limits rather than Min, Max to define the limits.
  2 件のコメント
Lavanya
Lavanya 2022 年 6 月 15 日
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.
example
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
end
How can i define limits for this condition
Simon Chan
Simon Chan 2022 年 6 月 15 日
sliderLimit = get(h.slider,'Limits') if sliderValue < sliderLimit(2) ………………

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpecial Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by