- Add MYFCT to the MATLAB path
- Define MYFCT as a subfunction in the GUI code
- Dynamically add the path to it in the GUI open callback and remove the path in the 'CloseRequestFcn' callback:
How to have a struct as input to an external function?
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I want to call an external function inside my matlab gui with the handles structure as input, as all my input parameters are inside that structure. However, when trying
myfct(handles)
Inside one of my callbacks in the gui m-file i receive a matlab error Undefined function 'myfct' for input arguments of type 'struct'.
I really don't know what Im doing wrong, especially because I have done similar earlier in my gui. Anyone who can help...
0 个评论
回答(2 个)
Ryan Livingston
2013-1-23
Odds are MYFCT is not on the path when the GUI code is running so it cannot be located. If you replace that with a call to:
which myfct
it should again say it is not found. You can try
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!