how to create a class with some properties?
1 回表示 (過去 30 日間)
古いコメントを表示
Mohmmad Abu Yousuf
2020 年 2 月 3 日
コメント済み: Mohmmad Abu Yousuf
2020 年 2 月 4 日
Hi everybody,
could you please assist me to create a class in with some properties?
I want to create two communication channel (paths) and want to call on the basis of their properties.
path_1_properties:
data_rate = 10 mbps
delay = 250 ms
loss rate = 1%
path_2_properties:
data_rate = 1.5mbps
delay = 50 ms
loss rate = 1%
could anyone please help me to have somesuggestion to make a class or list with these properties please.
Thank you in advance.
0 件のコメント
採用された回答
Eleanor Betton
2020 年 2 月 3 日
this should walk you through building a class.
4 件のコメント
Guillaume
2020 年 2 月 4 日
classes and structures are two different things. It doesn't sound like you fully understand OOP so I recommend you read the documentation and possibly grab a book.
You can create as many instances of the class as you want and name it whatever you want:
path1 = comm_channel;
path2 = comm_channel;
You can create class methods (function). In fact, if your class has no method, it's very much pointless (unless it's a base class for other classes). If you don't have class methods, then indeed a structure would be simpler.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!