パッケージのトップ階​層のリストを取得する​方法はありますか?

14 views (last 30 days)
MathWorks Support Team
MathWorks Support Team on 10 Sep 2021
Edited: MathWorks Support Team on 22 Apr 2024 at 23:04
Toolbox などであれば、インストールフォルダ名をたどって、
help rl
などでそのツリー構造を知ることができますが、これ以外の名前空間のツリー構造を知る方法があるか、教えてください。​
たとえば、
help matlab
で Tab キーを押下すると候補が出てきますが、このようなトップ階層を知る方法があるか、教えてほしいです。

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 22 Apr 2024 at 0:00
Edited: MathWorks Support Team on 22 Apr 2024 at 23:04
meta.package.getAllPackages コマンドを実行することでパッケージの最上位の階層をセル配列ですべて取得することができます。
pkgs = meta.package.getAllPackages();
例えば、ここから、最初の 10要素のセルの中の Name プロパティだけ取り出すと次のようになります。
>> cellfun(@(x)x.Name,pkgs(1:10),'UniformOutput',false)
ans =
  10×1 cell 配列
    {'sigio'            }
    {'rmitm'            }
    {'curvefitlib'      }
    {'asyncio'          }
    {'mpcapp'           }
    {'hdlcodingstd'     }
    {'fxptui'           }
    {'CodeGenAdvisor'   }
    {'SlicerApplication'}
    {'multicoredesigner'}
関数の詳細については以下の URL をご覧ください。

More Answers (0)

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!