how to use "range" in uislider

fig = uifigure;
s = uislider(fig,"range",1:50);
Error using uislider
Unrecognized property range for class Slider.
Error in untitled6 (line 2)
s = uislider(fig,"range",1:50);
i want this :

9 commentaires

Stephen23
Stephen23 le 18 Mai 2024
Modifié(e) : Stephen23 le 18 Mai 2024
Note that the "range" option is only supported since R2023b:
Presumably you are using an earlier version.
shamal
shamal le 18 Mai 2024
thank...but it's possible to write the chosen values ​​under the button?
Stephen23
Stephen23 le 18 Mai 2024
Overlay an AXES object, add two TEXT objects, modify their positions in the slider callbacks.
shamal
shamal le 19 Mai 2024
Are you sure that i can change position in label (text object) ?
K>> app.Label.Position
ans =
121.5185 671.4138 17.6296 13.5862 => this a label position
K>> app.Label.Position=[121.5185 671.4138 17.6296 13.5862] => i try to change it but it does not work
Warning: Unable to set 'Position', 'InnerPosition', or 'OuterPosition' for components in 'GridLayout'.
Stephen23
Stephen23 le 19 Mai 2024
Of course TEXT objects have a writeable POSITION property:
TEXT objects do not have a LABEL property.
shamal
shamal le 19 Mai 2024
Modifié(e) : shamal le 19 Mai 2024
excuse but i don't undertand your esample
I want to know information about position in "1" and "2"
the only information I have is:
app.FilerTimeRange_Slider
IF I USE YOUR EXAMPLE
t = text(0.5,0.5,'text here');
s = t.FontSize;
t.FontSize = 12;
it creates a new figure for me and it's not good
Stephen23
Stephen23 le 19 Mai 2024
"I want to know information about position in "1" and "2""
You want the VALUE property.
"it creates a new figure for me and it's not good"
Specify an existing figure as the parent. Even better: create axes first, exactly as I wrote in my earlier comment.
shamal
shamal le 19 Mai 2024
Modifié(e) : shamal le 19 Mai 2024
From my knowledge it's a bit difficult.. Here I made a reply to my problem (matlab_test.mlapp).. Can you edit the attached file with the solution? Thank you
Stephen23
Stephen23 le 20 Mai 2024
From my knowledge it's a bit difficult."
Certainly it would be quite fiddly to implement.
A simpler approach is to have some fixed (i.e. unmoving) e.g. UICONTROL displaying the values.

Connectez-vous pour commenter.

Réponses (1)

Voss
Voss le 18 Mai 2024

1 vote

2 commentaires

shamal
shamal le 18 Mai 2024
Modifié(e) : shamal le 18 Mai 2024
it's not correct..
I want double button to fix limit
see pics above
Voss
Voss le 18 Mai 2024
s = uislider(fig,"range","Limits",[1 50]);

Connectez-vous pour commenter.

Catégories

En savoir plus sur Labels and Annotations dans Centre d'aide et File Exchange

Question posée :

le 17 Mai 2024

Commenté :

le 20 Mai 2024

Community Treasure Hunt

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

Start Hunting!

Translated by