GUI problem while trying to call function from pushbutton1 to pushbutton2.
1 view (last 30 days)
Show older comments
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 Comments
Accepted Answer
Walter Roberson
on 28 Oct 2011
At the end of pushbutton1_Callback add the line
guidata(hObject, handles);
3 Comments
More Answers (0)
See Also
Categories
Find more on Debugging and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!