Output argument (and possibly others) not assigned value in the execution with "choosedialog2" function
29 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
venkat ta
il 22 Nov 2023
Commentato: venkat ta
il 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))
Risposta accettata
Walter Roberson
il 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)
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Migrate GUIDE Apps 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!