Where can I find “Spectrum” class definition file (contain classdef)?
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
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
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
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 Exchange 中查找有关 Construct and Work with Object Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!