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

Stephen23
Stephen23 2024년 5월 18일
편집: Stephen23 2024년 5월 18일
Note that the "range" option is only supported since R2023b:
Presumably you are using an earlier version.
shamal
shamal 2024년 5월 18일
thank...but it's possible to write the chosen values ​​under the button?
Stephen23
Stephen23 2024년 5월 18일
Overlay an AXES object, add two TEXT objects, modify their positions in the slider callbacks.
shamal
shamal 2024년 5월 19일
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 2024년 5월 19일
Of course TEXT objects have a writeable POSITION property:
TEXT objects do not have a LABEL property.
shamal
shamal 2024년 5월 19일
편집: shamal 2024년 5월 19일
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 2024년 5월 19일
"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 2024년 5월 19일
편집: shamal 2024년 5월 19일
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 2024년 5월 20일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Voss
Voss 2024년 5월 18일

1 개 추천

댓글 수: 2

shamal
shamal 2024년 5월 18일
편집: shamal 2024년 5월 18일
it's not correct..
I want double button to fix limit
see pics above
Voss
Voss 2024년 5월 18일
s = uislider(fig,"range","Limits",[1 50]);

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Labels and Annotations에 대해 자세히 알아보기

질문:

2024년 5월 17일

댓글:

2024년 5월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by