%The below line is in base workspace
C = char('red','red','red'); %The below code is in gui created by guide.
a = get(handles.popupmenu1,'Value') % Based on value from popup menu1 i have to decide where i should set option selected in popup menu2
val = get(handles.popupmenu2,'Value'); switch val case 1 assignin('base','C(a,:)','red'); case 2 assignin('base','C(a,:)','blue'); case 3 assignin('base','C(a,:)','black'); endIt shows an error Invalid variable name "C(a,:)" in ASSIGNIN.
MATLAB: Using assignin command in guide
guideMATLABpopupmenu
Best Answer