App Designer Error using matlab.ui.control.internal.model.AbstractNumericComponent/set.Value (line 111) 'Value' must be a double scalar.
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Phil Elamparo
il 11 Mag 2021
Modificato: Phil Elamparo
il 11 Mag 2021
Hello! I just want to ask how to fix the error shown in the title. My goal is to calculate the margin gains (Gm, Pm, Wcg, Wcp) and show the results in their respective fields that I used in the GUI for App Designer. Here is the code.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/615145/image.png)
I have used an Edit Field (Numeric) for the GUI for the calculated results for Gm, Pm, Wcg, and Wcp
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/615110/image.png)
Thank you in Advance
0 Commenti
Risposta accettata
Cris LaPierre
il 11 Mag 2021
In that line of code, you are converting the value of Gm to a string and then assigning the string to the Value property of your numeric editField.
The error is telling you the value must be a double, not a string.
The solution is to remove string() from any assignment to a numeric edit field..
app.GmEditField.Value = Gm;
1 Commento
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!