Create multiple limits on input GUI

Is there any way for me to create multiple limits on my edit field input in app design? So far this is what I tried out but this hasn't worked for me
switch app.From_Units_Temp.Value
case 'Celcius'
app.InitialValueEditField_Temp.Limits = [-273.15 Inf];
case 'Farenheit'
app.InitialValueEditField_Temp.Limits = [-459.67 Inf];
case 'Kelvin'
app.InitialValueEditField_Temp.Limits = [0 Inf];
case 'Rankine'
app.InitialValueEditField_Temp.Limits = [0 Inf];
end

Antworten (1)

Avratanu Biswas
Avratanu Biswas am 27 Nov. 2020

0 Stimmen

Hi,
What if you use UIspinners instead of EditFields ? And set the limits out there.

3 Kommentare

JULIEN BRAVO
JULIEN BRAVO am 28 Nov. 2020
Just tried it and still not able to make the multiple limits sadly, not sure if its even possible
Avratanu Biswas
Avratanu Biswas am 28 Nov. 2020
Sorry, then probably I din't get you . What's exactly your goal ? With UIspinner you can set your max and min limits (then the user has access to choose within that limit you assigned.), as you mentioned in your code (where you are using EditFieldbox).
JULIEN BRAVO
JULIEN BRAVO am 28 Nov. 2020
So I'm trying to make a unit converter app and this specific piece of code is for my temperature conversions. I need to make sure that the inputs that users give are within my specified limits but since temperature has different limits for different cases (for example: kelvin would be zero to infinity but celcius would be -273 to infinity) I'm trying to assign multiple limits my EditFieldBox (this is where the user will input their desired value to me converted).
also from my code: app.From_Units_Temp.Value - is a dropdown of different temperature units to choose from, thus thats where the switch statements come from

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 27 Nov. 2020

Kommentiert:

am 28 Nov. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by