Effacer les filtres
Effacer les filtres

App Designer Edit Field precision

34 vues (au cours des 30 derniers jours)
Andre Marcelino
Andre Marcelino le 24 Sep 2021
I have Outputs in App Designer as numeric edit fields (b0,b1,b2). These display calculated values and cause they are output values I don’t want them to be changed by the user. So I disabled the `editable` option, but that isn’t quite satisfactory, cause I like the behaviour of the editable option.
To be more precise, when you click on an editable field, you get a higher decimal precision. Like in the pictures, where I made b1 editable.
What I want to archive is an field, which shows me more decimal places, when I click it, but doesn’t accept any input.
Hopefully it’s understandable what I’m looking for and someone knows a way to do this.

Réponse acceptée

Andre Marcelino
Andre Marcelino le 24 Sep 2021
Okay, found a solution which is good enough for my requirements.
I just saved the b Parameters as properties. Thenn I used a callback for each edit field which checks if the value has changed against these properties. Whenever it is changed, it will reset. With this I can leave the field editable, but it can't be changed from the user interface, only from the intern function.

Plus de réponses (1)

Simon Allosserie
Simon Allosserie le 24 Sep 2021
Modifié(e) : Simon Allosserie le 24 Sep 2021
When you select the field, you can edit the ValueDisplayFormat code. Now it is apparently in some kind of scientific notation mode. If you want to have it in a float notation, try e.g.
there, which means your numbers will show as a float with 0 digits before the dot and 10 digits behind the dot. You can customize this as you wish.
  2 commentaires
Andre Marcelino
Andre Marcelino le 24 Sep 2021
First, thanks for the answer, but this isn’t what I want.
I want the output with scientific notation like in picture 1 and just when you click on the edit field, I want it to show more digits, like picture 2.
That’s also the natural behaviour, when the field is editable. But I don’t want the value be changeable by an input.
I came up with two possibilities, but don’t know how to get this, or if it is even possible.
1. An editable field, which doesn’t allow any input through keyboard. (Maybe realised by some sort of callback function)
2. An non-editable Field, which changes its output format by clicking on it
Simon Allosserie
Simon Allosserie le 24 Sep 2021
Then I don't know if Matlab supports such behavior.

Connectez-vous pour commenter.


En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by