0
我是Matlab新手。現在的任務是在GUI中顯示標題,並在腳本運行時不斷更新標題。如何在Matlab GUI中傳遞call_backs之間的值
我創建了一個名爲GUI界面,所以在主腳本是
Interface(title);
在GUI
function Interface_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Interface (see VARARGIN)
% Choose default command line output for Interface
handles.output = hObject;
handles.title = varargin{1};
% Update handles structure
guidata(hObject, handles);
我通過標題handles.title
。
,在格蘭靜態文本的call_back功能:
title =get(handles.title,'Value');
set(handles.text1,'String',title');
它不斷給我的錯誤信息說,我讀「試圖引用非結構陣列的領域。」
感謝您的幫助
'set(handles.text1,'String',title');'在'title'後面有'''不屬於那裏。 – 0xMB 2014-11-06 11:14:17