我有这些功能和一个带有两个轴(axes3 和axes4)和两个编辑文本和一个按钮的GUI。
function z=add(x,y)
z=x+y;
end
function z=mul(x,y)
z=x*y;
end
function pre(z1,z2)
plot(handles.axes3,z1,'b*');
set(get(handles.axes3,'Title'),'String','Number of Iterations');
set(get(handles.axes3,'XLabel'),'String','Number of Comlpeted Tours');
set(get(handles.axes3,'YLabel'),'String','MIN of Lenght of Tours');
plot(handles.axes4,z2,'r*');
set(get(handles.axes4,'Title'),'String','Number of Iterations');
set(get(handles.axes4,'XLabel'),'String','Number of Comlpeted Tours');
set(get(handles.axes4,'YLabel'),'String','MIN of Lenght of Tours');
end
function main(x,y)
z1=add(x,y);
z2=mul(x,y);
pre(z1,z2);
end
function pushbutton1_Callback(hObject, eventdata, handles)
x=str2double(get(handles.edit1_x,'String'));
y=str2double(get(handles.edit2_y,'String'));
main(x,y);
我有这个错误:
??? Undefined variable "handles" or class "handles.axes3".
Error in ==> main at 6
plot(handles.axes3,z1,'b*');
如何通过从 pre(z1,z2) 调用在 GUI 中的轴中显示我们的输出?