Is there a way to find all children of a Matlab class?

后端 未结 3 1573
孤城傲影
孤城傲影 2021-02-19 23:04

The Matlab function superclasses returns the names of all parents of a given class.

Is there an equivalent to find all classes derived from a given class, i

3条回答
  •  情歌与酒
    2021-02-19 23:32

    Not a complete solution, but, you could parse all .m files in the path as text, and use regular expressions to look for the subclass definitions.

    Something like ^\s*classdef\s*(\w*)\s*<\s*superClassName\s*(%.*)?

    Note that this will fail silently on any subclass definitions that use anything fancy, such as eval.

提交回复
热议问题