wait for user input in app designer
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello,
I am new to MatLab, I am trying to input 10 numbers using Edit field in the app designer, how ever my code does not wait for the input variables, it takes the 0 value and finishes. Is there a way to hold the program till I have finised inputing the values
I usnig the following way:
x = app.Syst1EditField.Value;
waitfor(x);
Msys=mean (x);
but this also does not work. Please let me know if there is some way to fix this.
1 Commento
Ajay Kumar
il 29 Nov 2019
you want to enter 10 digt number into one editfield ? or 10 separate editfields?
Risposte (1)
Dhananjay Kumar
il 5 Dic 2019
Modificato: Dhananjay Kumar
il 5 Dic 2019
Add a Text-type edit field (icon:
). This will take the input as character array (Here, default value will be empty character array, not 0). You can write multiple numbers in the edit field separated by spaces.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/252998/image.png)
Add callback to the edit-field by right-clicking on the edit box. This will take you to callback function's code.
Inside the callback function, write this:
x = app.EditField.Value;
xarray = str2num(vxalue); %% This will make numeric array from the input
Msys = mean(xarray);
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!