Limits of app-designer spinner input field
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
José M. Requena Plens
il 16 Mar 2021
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
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!