Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. function varargout = cached(cache_filepath, f, varargin )
  2.  
  3. if exist(cache_filepath, 'file') == 2
  4. load(cache_filepath, 'varargout');
  5. else
  6. [varargout{1:nargout}] = f( varargin{:} );
  7. save(cache_filepath, 'varargout');
  8. end
  9.  
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement