Mohmd - you have two push button callbacks as follows
function pushbutton1_Callback(hObject, eventdata, handles)
humanHEXA = getgenbank('NM_000520')
humanProtein = nt2aa(humanHEXA.Sequence,'frame',3)
function pushbutton2_Callback(hObject, eventdata, handles)
mouseHEXA = getgenbank('AK080777')
mouseProtein = nt2aa(mouseHEXA.Sequence)
where each defines local variables humanProtein and mouseProtein respectively. Your checkbox callbox is defined as
function checkbox2_Callback(hObject, eventdata, handles)
seqdotplot(mouseProtein,humanProtein,4,3)
ylabel('Mouse hexosaminidase A (alpha subunit)')
xlabel('Human hexosaminidase A (alpha subunit)')
The first line of code (after the signature) references two undefined variables, the mouseProtein and humnaProtein. This is probably the source of your error: your code is referencing variables that have been defined locally in other callbacks. When using GUIDE to design your GUI, if you create a local variable in one callback function that you want to reference in another callback function, you need to save this variables as user-defined data within the handles structure. To do this, change your pushbutton callbacks as follows
function pushbutton1_Callback(hObject, eventdata, handles)
humanHEXA = getgenbank('NM_000520');
handles.humanProtein = nt2aa(humanHEXA.Sequence,'frame',3);
guidata(hObject,handles);
function pushbutton2_Callback(hObject, eventdata, handles)
mouseHEXA = getgenbank('AK080777');
handles.mouseProtein = nt2aa(mouseHEXA.Sequence);
guidata(hObject,handles);
In the above, we save each local variables as a field within handles and then save the updated structure using guidata. Now, in your checkbox callback, you would do
function checkbox2_Callback(hObject, eventdata, handles)
if isfield(handles,'mouseProtein') && isfield(handles,'humanProtein')
seqdotplot(handles.mouseProtein,handles.humanProtein,4,3);
ylabel('Mouse hexosaminidase A (alpha subunit)');
xlabel('Human hexosaminidase A (alpha subunit)');
end
In the above, we check to see if the handles structure has the two fields that we are interested in using isfield. If both exist, then we get each variable by accessing the desired field within that structure.
Try the above and see what happens!
Best Answer