how can I call a class in a gui?

2 次查看(过去 30 天)
jibs
jibs 2021-9-14
评论: jibs 2021-10-25
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 个评论
TADA
TADA 2021-9-14
There's no general rule. can you please elaborate a little on the context?

请先登录,再进行评论。

回答(1 个)

Matt J
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
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.
jibs
jibs 2021-10-25
I have defined the class using classdef the name of class is TimeData, i have not defined its functions yet in class.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Software Development Tools 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by