how can I call a class in a gui?

4 ビュー (過去 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 Center および File ExchangeSoftware Development Tools についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by