data from custom preview function to Table in the GUI

1 view (last 30 days)
Im using GUIDE to make a matlab GUI which does some video computation. Using the preview function I can preview the live video from my webcam and do some calculations.
In the MainGUI i use the: setappdata(hImage,'UpdatePreviewWindowFcn',mypreview_fcn); to get to a custom preview function which is:
function mypreview_fcn(obj,event,himage)
originalframe=peekdata(vidobj,1);
while isempty(originalframe)
originalframe=peekdata(vidobj,1);
end
if kk>=1
[LogResult,y,dist]=QueryArduino;
if LogResult==1
kk=kk+1;
results{kk,1}=originalframe;
results{kk,2}=measure1;
results{kk,3}=measure2;
results{kk,4}=measure3;
results{kk,5}=measure4;
results{kk,6}=measure5;
results{kk,7}=measure7;
offset=median([results{:,7}]);
offset=measure2-measure3;
end
end
set(himage,'CData',originalframe);
end
I would like to pass the result matrix to a table in the MainGUI How can I access the GUI table;
  3 Comments
Mimis Patoukas
Mimis Patoukas on 3 Mar 2015
Just tried this.It ends up with an unidentified function or variable. I guess I could try
handles=guidata(MainGUI)
but this would take some time customizing my code.
Adam
Adam on 3 Mar 2015
Basically you just need the handles struct from wherever is simplest. Otherwise you may try findobj, but I never use that and don't like it so I guess someone else can help advise on that.

Sign in to comment.

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!