I would like to programme a dynamic dropdown menu where a user can load an dataset and it will show the dataset when the user click on it. I could manage to get a dynamic string list but I don't know how to make the switch-case dynamic.
val=get(hObject,'value');
axes(handles.axes1);
switch val
case 1
imshow('trollface.jpg');
case 2
imshow('Forever-alone-face.png');
case 3
imshow('yao-ming.png');
otherwise
end
guidata(hObject,handles);
Here is an example. However, the number of cases should be dynamic in a way that if a user Click A then the data A should be loaded. Do you have any suggestions how I can do this? Thanks