主题:请教gui编程问题
我在gui编程的时候,遇到了下面的问题,能不能有哪位大侠指导一二,不胜感激。
function verticalS_Callback(hObject, eventdata, handles)
% hObject handle to verticalS (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',findobj(gcf,'Type','Axes')); %%设置当前坐标
V0 = str2double(get(handles.vsudu,'string')); %%从编辑框里得到数
A0 = str2double(get(handles.vjiasudu,'String'));
S0 = str2double(get(handles.vgaodu,'String'));
diantiweiyi(V0,A0,S0); %%将得到的数代入函数diantiweiyi,V0,A0,S0分别是它的输入变量。分步运行以后发现在这个函数中并没有将V0,A0,S0输入进来。不知道怎么才能将输入进来的数代入这个函数呢?
运行以后是下面的错误提示:
??? Reference to a cleared variable S0.
Error in ==> <a href="error:D:\MATLAB7\work\chuizhijiemian\diantiweiyi.m,46,1">diantiweiyi at 46</a>
[t1 t2 t3]=time1(S0,V0,A0);
Error in ==> <a href="error:D:\MATLAB7\work\chuizhijiemian\verticalresponse.m,96,1">verticalresponse>verticalS_Callback at 96</a>
diantiweiyi(V0,A0,S0);
function verticalS_Callback(hObject, eventdata, handles)
% hObject handle to verticalS (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',findobj(gcf,'Type','Axes')); %%设置当前坐标
V0 = str2double(get(handles.vsudu,'string')); %%从编辑框里得到数
A0 = str2double(get(handles.vjiasudu,'String'));
S0 = str2double(get(handles.vgaodu,'String'));
diantiweiyi(V0,A0,S0); %%将得到的数代入函数diantiweiyi,V0,A0,S0分别是它的输入变量。分步运行以后发现在这个函数中并没有将V0,A0,S0输入进来。不知道怎么才能将输入进来的数代入这个函数呢?
运行以后是下面的错误提示:
??? Reference to a cleared variable S0.
Error in ==> <a href="error:D:\MATLAB7\work\chuizhijiemian\diantiweiyi.m,46,1">diantiweiyi at 46</a>
[t1 t2 t3]=time1(S0,V0,A0);
Error in ==> <a href="error:D:\MATLAB7\work\chuizhijiemian\verticalresponse.m,96,1">verticalresponse>verticalS_Callback at 96</a>
diantiweiyi(V0,A0,S0);