-1
我是matlab新手,并没有太长的时间来生成相互连接的GUI。从特定的例子开始工作要容易得多。我已经找到了通用的例子,但不知道哪些部分是Matlab函数,哪些需要编辑。是否有可能证明此代码如何将来自edittext的信息传递到bladedesign.fig以及如何在bladedesign.fig中访问它们?在Matlab中的GUI之间传递变量
按钮4是一个提交按钮。 edittext9是一个可变的文本框。
function edit9_Callback(hObject, eventdata, handles)
% hObject handle to edit9 (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 edit9 as text
% str2double(get(hObject,'String')) returns contents of edit9 as a double
% --- Executes during object creation, after setting all properties.
function edit9_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close(gcf)
openfig(bladedesign.fig)
对不起我的意思designblade.m 所以在designblade.m我可以访问menu.m中的句柄? 我只需要在designblade.m中以相同的方式调用数据,因为我必须稍后在menu.m中进行计算。 – Marc 2013-04-06 20:01:25