Where can I find “Spectrum” class definition file (contain classdef)?

1 回表示 (過去 30 日間)
Bob Li
Bob Li 2011 年 12 月 29 日
Hi,
Where can I find the definition of a built-in class, such as “spectrum”?
I read Object-Oriented Programming R2011b documents and read that there are two basic ways for defining classes:
1. all in a single file
2. in a folder @ClassNameA with the same name as the class.
However, for Spectrum class in Signal Processing Toolbox, although there is a folder:
C:\Program Files\MATLAB\R2008a\toolbox\signal\signal\*@spectrum*
There is no same name spectrum.m file which would contain classdef definition.
Could anyone tell me why? Where can I find the class definition?
Bob

回答 (1 件)

Wayne King
Wayne King 2011 年 12 月 29 日
Hi Bob, the spectrum objects you refer are "old" objects having been introduced back in MATLAB R14 (Signal Processing Toolbox version 6.2).
They are not MCOS objects utilizing the new standard of OO programming in MATLAB. The keyword classdef to signal the construction of an MCOS class was introduced first in R2008.
Accordingly, you won't be able to find a corresponding classdef for those objects.
  3 件のコメント
Wayne King
Wayne King 2011 年 12 月 29 日
Enter
>>ver
but what I'm saying is that the spectrum object were introduced back in R14, they are older than the classdef syntax you are thinking about. That is a newer version of MATLAB OO programming. If those spectrum objects were introduced in R2008 (or later), they would have used the classdef
Wayne King
Wayne King 2011 年 12 月 29 日
Bob, just to give a bit more information, the spectrum objects are an example of a UDD object, or a schema object. The class definitions for the schema objects are not like those of the MCOS.
The class definition for the UDD objects are in schema files that you are likely to find p-coded, e.g. schema.p

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

カテゴリ

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