M-file dependency consolidator

バージョン 1.1.0.0 (1.92 KB) 作成者: Jit
Will take a given m-file, or directory of such files, and consolidate any dependent m/mex files
ダウンロード: 803
更新 2011/4/26

ライセンスの表示

This function will take a given m-file, or directory of such files, and copy all necessary related function files (m and mex) to the target directory, excluding any MatLab provided ones (e.g. toolboxes).

I often have to distribute my code to others who'd like run similar numerical models, (un)fortunately my software-engineer mindset means a lot of reused functions, scattered over a number of organized 'tool' folders in my matlab path.
This makes packaging everything needed to give to someone else a bit difficult.
MatLab provides a dependency report tool, but it isn't recursive, and does not provide the ability to even open the dependent files, let alone copy them.

My search for a solution turned up 2 promising functions in File Exchange, but neither worked for me - and when I tried to edit them, it was apparent that they were far more cluttered than needed to be.

So I wrote my own from scratch.
I hope it will be useful for others as well.

Known issues:
if the same dependent function is encountered in multiple source files (directory traversal), it is copied multiple times and will have multiple entries in output file list.
I'm not sure how to avoid this without complicating the recursion too much.

引用

Jit (2025). M-file dependency consolidator (https://jp.mathworks.com/matlabcentral/fileexchange/31164-m-file-dependency-consolidator), MATLAB Central File Exchange. に取得済み.

MATLAB リリースの互換性
作成: R2010b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersSearch Path についてさらに検索
謝辞

ヒントを得たファイル: package

ヒントを与えたファイル: Project Release ZIP File from Dependencies

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.1.0.0

Fixed typo identified by Gordon and Jedediah.

Also fixed an error in the file list output - it was including files that were skipped as well.

1.0.0.0