Temporary (or anonymous) function handles for ML 6

バージョン 1.0.0.0 (2.18 KB) 作成者: Nathan Thern
Creates a temporary function m-file and returns a handle to it.
ダウンロード: 1.3K
更新 2005/1/28

ライセンスの表示

The anonymous function handle feature of ML 7 is a long-needed feature, and one that I have longed for since I began writing scripts in early ML 6.

Unfortunately, I am still forced to use ML 6 most of the time, so I came up with a way to create "psuedo-anonymous" function handles: that is, function handles to real m-file functions that are created on the spot and will be deleted in the near future.

TMP_HANDLE writes out a temporary function m-file in its private subdirectory and then returns a handle to it. As a side effect, it searches for old temporary function files and deletes them.

I have TMP_HANDLE set to delete temporary function m-files that are older than 30 days. The whole idea of cluttering up a subdirectory with little m-files is distasteful, but not really a big deal given modern disk sizes. I have chosen to live with it.

Next step:
Make TMP_HANDLE a class with overloaded feval and subsref so you can call
feval(t_hndl,x,y)
OR just
t_hndl(x,y)

Matlab 5 has feval and classes with overloading, so making tmp_handle a class should allow it to work with ML 5.

引用

Nathan Thern (2024). Temporary (or anonymous) function handles for ML 6 (https://www.mathworks.com/matlabcentral/fileexchange/6755-temporary-or-anonymous-function-handles-for-ml-6), MATLAB Central File Exchange. 取得済み .

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

Community Treasure Hunt

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

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

Improved the documentation