急!MATLAB的GUI界面中怎样通过edit text把值赋给变量a?
我原程序是这样的,试过不行functionlength_input_Callback(hObject,eventdata,handles)%hObjecthandleto...
我原程序是这样的,试过不行
function length_input_Callback(hObject, eventdata, handles)
% hObject handle to length_input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of length_input as text
% str2double(get(hObject,'String')) returns contents of length_input as a double
length=str2num(get(handles.length_input,'string'));
%变量名为length,edit text标签为length_input 展开
function length_input_Callback(hObject, eventdata, handles)
% hObject handle to length_input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of length_input as text
% str2double(get(hObject,'String')) returns contents of length_input as a double
length=str2num(get(handles.length_input,'string'));
%变量名为length,edit text标签为length_input 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询