Output argument (and possibly others) not assigned value in the execution with "choosedialog2" function
24 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
venkat ta
le 22 Nov 2023
Commenté : venkat ta
le 23 Nov 2023
The code worked for all cell number selections except the first index of 1
Not sure where to correct and run the code?
specific_index = choosedialog2(num2cell(1:20))
Réponse acceptée
Walter Roberson
le 22 Nov 2023
uicontrol() style popup only triggers the callback when the selection changes
When you create a uicontrol popup, the default selection Value is 1 -- first item already selected.
What you typically end up doing is adding a header item such as 'Select Item' as the first String, so that the user has to change selection in order to select "1" .
If you do that remember that the entries are now offset by 1 -- the entry for "1" is at Value 2, the entry for "2" is at Value 3, and so on.
And remember that your processing code has to handle the possibility that later the user will chose to switch back to the header.
... And remember that this does not solve the problem of the user wanting to select the same entry twice in a row -- not unless you reset the Value to 1 (the header)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Migrate GUIDE Apps 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!