In GUI, RangeSlider 's Value may have a wrong type

1 次查看(过去 30 天)
The offical document says that it is a two-element numeric array, But when I try to get value from it like this:
[minFrq,maxFrq] = app.FilterHzSlider.Value;
it throw a error, said that the number of value is not enough.So I have a test:
X = app. FilterHzSlider.Value;
disp(class(x));
the result is:
double
then I try this:
x=app.FilterHzslider.value;
disp (num2str (x));
then result is:
50 1000
It is confusing.

采纳的回答

Fangjun Jiang
Fangjun Jiang 2024-4-8
No confusion. You will find
X = app. FilterHzSlider.Value;
X is returned as [50 1000].
So you would do
minFrq=X(1);
maxFrq=X(2);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by