フィルターのクリア

Is it possible to assign a table to a function for speed up?

1 回表示 (過去 30 日間)
Mr M.
Mr M. 2017 年 7 月 18 日
回答済み: Jonathan A 2019 年 10 月 9 日
In Maple (for example) it is possible to assign a table to a function in which outputs are collected during running, and can be used to speed up calculatios when we run the function twice or more times with the same argument(s). Are there anything like this in MATLAB?
  1 件のコメント
Mr M.
Mr M. 2017 年 7 月 18 日
If there is no built-in solution for this. How can I handle it in general? For example I can write my own table and my own function, for example 'myerf.mat' (data) and 'myerf.m' (function). But reading from the table can be slow also, if I open the file for every calling. But opening the myerf.mat data file just once, how can I acces the global variable in the function?

サインインしてコメントする。

回答 (2 件)

Walter Roberson
Walter Roberson 2017 年 7 月 18 日
No. However starting in R2017a see memoize().
  2 件のコメント
Mr M.
Mr M. 2017 年 7 月 21 日
Is it possible to do this with the usage of persistent variables? Or it will be slow?

サインインしてコメントする。


Jonathan A
Jonathan A 2019 年 10 月 9 日
It is maybe a little bit late, but I implemented a class that encapsulates the functionnality of cachedcall. The class builds the dependency DAG of all functions and computes only the necessary ones. This allows to spare a lot of time in my current scientific workflow. Hope this helps.

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by