MATLAB Function Reference    
genpath

パス文字列を作成

表示

詳細

genpath は、matlabroot/toolbox の下のすべてのディレクトリをリカーシブに付加することで、型作るパス文字列を出力します。

genpath directory は、directory の下のすべてのディレクトリをリカーシブに付加することで、型作るパス文字列を出力します。

p = genpath('directory') は、パス文字列を変数 p に出力します。

例題

つぎのコマンドをもつ matlabroot\toolbox\images とすべてのディレクトリを含むパスを出力します。

p = genpath(fullfile(matlabroot,'toolbox','images'))

p =

matlabroot\toolbox\images;matlabroot\toolbox\images\images; matlabroot\toolbox\images\images\ja;matlabroot\toolbox\images\ imdemos;matlabroot\toolbox\images\imdemos\ja;

参考

path, addpath, rmpath


 gco get