"TS.Global" I got this as a part of a matlab code. Can anyone help to understand what does mean? I have seen this dot operator as a part of structure; is this mean the same?

3 ビュー (過去 30 日間)
If any documentation regarding this; kindly share.....
  2 件のコメント
BIPIN SAMUEL
BIPIN SAMUEL 2022 年 8 月 18 日
編集済み: BIPIN SAMUEL 2022 年 8 月 18 日
@Walter Roberson Actually it is from a matlab function code. My doubt is why we use that dot operator; I have seen dot operator with structure data. Can we use anywhere else other that numerical calculation?

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2022 年 8 月 18 日
The dot operator such as TS.Global can mean:
  • That TS is a struct(), and Global is a field in the struct
  • That TS is an object, and Global is a property of the object. It is not necessarily an object created in MATLAB: it might be an object created in Java for example
  • That TS is an object, and Global is a method associated with the object. It is not necessarily an object created in MATLAB; it might be an object created in Java for example
  • That TS is a package created with a +TS directory and Global is a function defined in the package; https://www.mathworks.com/help/matlab/matlab_oop/scoping-classes-with-packages.html
TS.Global appears to be used in the Model Based Calibration toolbox. When I chase back the source of TS from old mbcmodels/@xregoptmgr source code that I find online, then it appears that the variable TS is a "model", probably of class mbcmodels or a subclass of that.
Possibly these days the Global property corresponds to https://www.mathworks.com/help/mbc/mbccommandline/global.html
  14 件のコメント
BIPIN SAMUEL
BIPIN SAMUEL 2022 年 8 月 26 日
編集済み: BIPIN SAMUEL 2022 年 8 月 26 日
@Walter Roberson Yes, Thank You very much....
Image Analyst
Image Analyst 2022 年 8 月 26 日
But you should have already had that file if you had the stats toolbox installed.
  1. Did you not have the stats toolbox installed and had to buy it?
  2. Or did you have your own version of mle.m that it was using instead of the toolbox version?

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2022 年 8 月 18 日
TS is probably either a class or a structure. Global could be a field of the TS structure. Or if TS is a static class, Global could be a method of the static class. Or if TS is an instance of some class (with a different name) then Global could be a method or the class or a property of the class.
But why didn't you answer Walter's question when he asked you to put this in your code and tell us what it says:
class(TS)

コミュニティ

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by