Main Content


Class: matlab.metadata.Namespace
Namespace: matlab.metadata

Get all top-level namespaces

Renamed from meta.package.getAllPackages in R2024a


P = matlab.metadata.Namespace.getAllNamespaces


P = matlab.metadata.Namespace.getAllNamespaces returns a cell array of matlab.metadata.Namespace objects representing all the top-level namespaces that are visible on the MATLAB® path or defined as top-level built-in namespaces. You can access inner and outer namespaces using the InnerNamespaces and OuterNamespace properties of each matlab.metadata.Namespace object.


The time required to find all the namespaces on the path might be excessively long in some cases. You should therefore avoid using this method in any code where execution time is a consideration. getAllNamespaces is generally intended for command line use only.



To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2008a

expand all