Returning Data from a GUIDE GUI
显示 更早的评论
Holy COW !!! I've created a simple GUIDE GUI that allows me to select specific files or choose a top level path so the code can search for files - all that match certain regular expression file names. All is good... to the point where I can create a cell array of fully qualified file names for downstream work. Unfortunately, I CANNOT seem to figure out how to return this cell array to the calling program or interactive workspace. I've tried adding the cell array to varargout as something like varargout{2} = handles.user.fileList and I've tried using handles.output, where handles.output = handles.user.fileList followed by the appropriate guidata call to update. These are done in my event handler for the "Accept" button.
I've walked through the code and the OpeningFcn is called early on AS IS the OutputFcn, which seems a little crazy to me. It almost seems like this GUIDE GUI is setting up its output just after the GUI is realized and NOT allowing it to update later. I've also tried updating varargout and/or handles.output in the DeleteFcn which I thought was the last thing called upon termination (like I kill the GUI at the end of the AcceptButton code.
But none of this seems to work. Anyway, I'm a solid programmer (IDL, Python, & Java) but relatively new to MATLAB. I know this question must seem kinda dumb, but I've been wrestling this for some time now... !!!???
Thanx
回答(1 个)
Fangjun Jiang
2011-8-26
0 个投票
Watch this video. Seems to be exactly what you want.
类别
在 帮助中心 和 File Exchange 中查找有关 Server Management 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!