Output argument (and possibly others) not assigned value in the execution with "choosedialog2" function
45 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
venkat ta
el 22 de Nov. de 2023
Comentada: venkat ta
el 23 de Nov. de 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))
1 comentario
Respuesta aceptada
Walter Roberson
el 22 de Nov. de 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)
Más respuestas (0)
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!