Limits of app-designer spinner input field
9 次查看(过去 30 天)
显示 更早的评论
I have an app-designer spinner input field called app.A. I can set its limits by below:
app.A.Limits = [1, max(cruiseList)];
Here is the problem, if I only have one cruise and the max(cruiseList) is equal to one, the system will throw out an error?
Why can't I have the min and max values to be equal when my only option at this situation should be no other option, i.e., just 1?
Thanks
0 个评论
采纳的回答
José M. Requena Plens
2021-3-16
Limits cannot be assigned equal.
I would first check the value of 'max (cruiseList)', if it is lower or equal to 1 I would not assign the limits to the spinner. In this case, I would hide it or disable it since it would have no use.
Hiding:
if max(cruiseList)<=1
app.A.Visible = 'off'
app.A.Value = 1;
else
app.A.Limits = [1, max(cruiseList)];
end
Disabling
if max(cruiseList)<=1
app.A.Enable = 'off'
app.A.Value = 1;
else
app.A.Limits = [1, max(cruiseList)];
end
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!