Is there exist() functionality for packages/namespaces?
古いコメントを表示
Create a package and put it somewhere in Matlab's path. If you know the parent directory, you could use exist('/path/+package'), but you don't need to know the path to use the package, so that's silly.
The current best solution I have is to try/catch calling a function in the package.
採用された回答
その他の回答 (1 件)
You can exist() a function inside the package
exist('matlab.internal.lang.capability.Capability')
which matlab.internal.lang.capability.Capability
You can also which the + form of a function (but not the package itself)
which +matlab/+internal/+lang/+capability/Capability
which +matlab/+internal/+lang/+capability
5 件のコメント
Chris
2023 年 1 月 7 日
Walter Roberson
2023 年 1 月 7 日
matlab.internal.lang.capability.Capability is an example of package.function but which and exist work for it ? (notice it is + all the way down to +capability so matlab.internal.lang.capability is the package and Capability is the function)
Walter Roberson
2023 年 1 月 7 日
Class methods can be found using which, but sometimes they will not be located unless the class has been loaded at least once in this session (since the last clear classes)
カテゴリ
ヘルプ センター および File Exchange で Software Development Tools についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!