Hello everyone! I build a GUI for a main code that I have and based on the GUI, the user is supposed to enter a number, N. Once the number is entered, N is used to generate the list of a popup menu. example of list:
N = 3User 1User 2User 3
my code and GUI functions properly, except when N is greater than 9. Then, instead of displaying User 10 in the pop up menu list, it is displaying User 1 User 0. This is occurring for all 2 digit numbers.
I tried a lot of options but none are actually working and I really need help! If anyone knows how to fix this, please help me!
This is the code I used:
for k = 2:(N+1) string2{k} = sprintf('User %1.0g\n',(num2str((k-1),2)-48));endset(handles.popupmenu2,'String',string2)
Thank you
Best Answer