MATLAB类的描述和DetailedDescription属性(Description and D

2019-08-03 20:51发布

内置MATLAB类有一个描述和DetailedDescription属性值:

>> ?handle
ans = 
  meta.class handle
  Package: meta

  Properties:
                     Name: 'handle'
              Description: 'Base class for handle classes'
      DetailedDescription: ''
[snip]

同样,一些方法和内置类的属性具有相同的属性:

>> a = ?containers.Map;
>> a.PropertyList(1)
ans = 
  meta.property handle
  Package: meta

  Properties:
                   Name: 'Count'
            Description: 'Number of pairs in the collection'
    DetailedDescription: ''
[snip]

如何设置这些属性为我的类/方法/属性?

Answer 1:

使用参数的classdef:

classdef (Description='A type of story.',...
    DetailedDescription='Once upon a time..') MyFairyTaleClass

命令行:

>> ?MyFairyTaleClass

ans = 

  meta.class handle
  Package: meta

  Properties:
                     Name: 'MyFairyTaleClass'
              Description: 'A type of story.'
      DetailedDescription: 'Once upon a time..'
                   Hidden: 0
                   Sealed: 0
          ConstructOnLoad: 0
         HandleCompatible: 0
          InferiorClasses: {0x1 cell}

这是一个无证的功能似乎。



文章来源: Description and DetailedDescription attributes of MATLAB classes
标签: oop matlab