GUI problem while trying to call function from pushbutton1 to pushbutton2.
1 回表示 (過去 30 日間)
古いコメントを表示
i want to access data from push button1 to push button2. here is my code
function pushbutton1_Callback(hObject, eventdata, handles)
[FileName,PathName] = uigetfile('*.avi');
PathOriginal=sprintf('%s%s',PathName,FileName);
readobj1=mmreader(PathOriginal);
readobj = readobj1;
%set(handles.pushbutton1,'UserData',readobj);
function pushbutton2_Callback(hObject, eventdata, handles)
%readobj=get(handles.pushbutton1,'UserData');
vidframes=read(handles.readobj);
numframes=get(readobj,'numberOfFrames');
when i run this file..i am getting error like this...any one please help me.
error message in command window:
Reference to non-existent field 'readobj'.
Error in ==> trying>pushbutton2_Callback at 96
vidframes=read(handles.readobj);
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> trying at 43
gui_mainfcn(gui_State, varargin{:});
Error in ==>
@(hObject,eventdata)trying('pushbutton2_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
this might looks like easy one. but i am new to gui design. so please help. whats going on here in call back functions. please help me. Thank you.
0 件のコメント
採用された回答
Walter Roberson
2011 年 10 月 28 日
At the end of pushbutton1_Callback add the line
guidata(hObject, handles);
3 件のコメント
Walter Roberson
2011 年 10 月 28 日
Ah, your line
readobj = readobj1;
should be
handles.readobj = readobj1;
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Debugging and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!