Cleanest way to cache function results in MATLAB

后端 未结 3 1438
轻奢々
轻奢々 2020-12-31 07:30

I have quite a heavy function in MATLAB:

function [out] = f ( in1, in2, in3)

Which is called quite often with the same parameters. The func

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-31 08:03

    MATLAB now ships with a function just for this purpose. The technique used is called "memoization" and the function's name is "memoize".

    Check out : https://www.mathworks.com/help/matlab/ref/memoize.html

提交回复
热议问题