How to have a class that contains multiple functions that is used in other classes?
9 次查看(过去 30 天)
显示 更早的评论
I've been having a hard time trying to figure out how to have multiple functions in one class (a "Utility_Class") that can be used within other classes ("Tech1", "Tech2", & "Tech3").
I know I have to import, but what is the right approach on importanting and how do I call the method to be applied within the following classes: "Tech1", "Tech2", & "Tech3".
If I need to add more context, I'm willing to add more.
1 个评论
采纳的回答
Matt J
2023-12-4
编辑:Matt J
2023-12-5
A static class method can be imported from a package like in this example,
You can also import a static method that is not packaged,
import Utitlity_Class.methodname
but I think most people just call the static method using the fully qualified name Utitlity_Class.methodname().
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!