Limits of app-designer spinner input field

9 visualizaciones (últimos 30 días)
Leon
Leon el 16 de Mzo. de 2021
Comentada: Leon el 16 de Mzo. de 2021
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

Respuesta aceptada

José M. Requena Plens
José M. Requena Plens el 16 de Mzo. de 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

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by