Clear Filters
Clear Filters

GUI problem while trying to call function from pushbutton1 to pushbutton2.

3 views (last 30 days)
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.

Accepted Answer

Walter Roberson
Walter Roberson on 28 Oct 2011
At the end of pushbutton1_Callback add the line
guidata(hObject, handles);
  3 Comments
Sandhu
Sandhu on 28 Oct 2011
wowww........Walter it works grate. superb....
Thank you very much for you valuable help.

Sign in to comment.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps 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!