Previous Value of Numeric Edit Field
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
John Smith
il 16 Feb 2020
Commentato: John Smith
il 17 Feb 2020
Hi all,
Is there a quick way to reference the previous value of an App Deigner numeric edit field? This is in order to reset the value after an error dialog has been shown. Something like
app.NumericEditField.Value = app.NumericEditField.PreviousValue
would be ideal.
Many thanks.
0 Commenti
Risposta accettata
Joseph Cheng
il 16 Feb 2020
I think thats almost what you'd want do have and store prevvalue during during successful calculation. Previousely in GUIDE and UIcontrol type construction there was a userdata field. I haven't been using appdesigner but it looks to be gone from a cursory inspection. However you can set a private/public property as a place to store the previous value upon successful computation run.
app.NumericEditField_N_PreviousValue= app.NumericEditField.Value
and
app.NumericEditField.PreviousValue= app.NumericEditField_N_PreviousValue
during an error catch.
Più risposte (1)
Ajay Kumar
il 16 Feb 2020
Try to save the Previous value in a temporary variable. For eg:
temp = app.NumericEditField.Value;
if error
app.NumericEditField.Value = temp;
else
app.NumericEditField.Value = newvalue;
end
0 Commenti
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!