how can I call a class in a gui?
8 次查看(过去 30 天)
显示 更早的评论
Hi! im working on OOP, I have defined a class TimeData by a script and its saved in the working folder.
now how can i call that class in my GUI. Should i call in opening function. or in any button?
1 个评论
回答(1 个)
Matt J
2021-9-14
I have defined a class TimeData by a script
Don't you mean you defined it in a classdef file? The constructor function for a class can be called from anywhere, as long as the classdef file is on the Matlab path. In particular, the current folder is always on the Matlab path.
3 个评论
Matt J
2021-9-17
You haven't shown us the error messages that you get when you try to call it. There's no reason why you shouldn't be able to.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Software Development Tools 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!