0
嗨我想创建一个GUI链接到我的3米文件。在Matlab中,如何创建一个GUI来与3个现有的m文件进行交互?
1)findcontrolpoints.m 2)morph.m 3)morphvideo.m
在1)中,我需要的点的数量的用户输入。输入将被输入到GUI中,然后我希望将该变量传递给findcontrolpoints.m文件进行处理。这将通过按下按钮1完成。有没有办法做到这一点?
function inputpoints_Callback(hObject, eventdata, handles)
% hObject handle to inputpoints (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 inputpoints as text
% str2double(get(hObject,'String')) returns contents of inputpoints as a double
input = str2num(get(hObject, 'String'));
if (isempty(input))
set(hObject, 'String', '50')
end
guidata(hObject, handles);
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% hMainGui = getappdata(0, 'hMainGui');
% fileName = uigetfile('*.jpg');
points = get(handles.inputpoints,'String');
findfeaturepoint(points);