-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