clearAllMemoizedCaches
모든 MemoizedFunction
객체의 캐시 지우기
설명
clearAllMemoizedCaches
는 모든 MemoizedFunction
객체의 캐시를 지웁니다.
예제
메모이제이션(Memoization)이 적용된 함수 캐시 모두 지우기
메모이제이션이 적용된 함수를 2개 만들고 여러 번 호출합니다.
mf1 = memoize(@sin); mf2 = memoize(@cos); a = [mf1(0) mf1(pi/2) mf1(pi)]; b = mf2(pi/2);
메모이제이션이 적용된 함수 객체에 대한 통계량을 확인합니다.
mf1.stats.Cache
ans = struct with fields:
Inputs: {{1x1 cell} {1x1 cell} {1x1 cell}}
Nargout: [1 1 1]
Outputs: {{1x1 cell} {1x1 cell} {1x1 cell}}
HitCount: [0 0 0]
TotalHits: 0
TotalMisses: 3
mf2.stats.Cache
ans = struct with fields:
Inputs: {{1x1 cell}}
Nargout: 1
Outputs: {{1x1 cell}}
HitCount: 0
TotalHits: 0
TotalMisses: 1
메모이제이션이 적용된 함수 캐시를 모두 지우고 통계량을 다시 확인합니다.
clearAllMemoizedCaches mf1.stats.Cache
ans = struct with fields:
Inputs: {}
Nargout: []
Outputs: {}
HitCount: []
TotalHits: 0
TotalMisses: 0
mf2.stats.Cache
ans = struct with fields:
Inputs: {}
Nargout: []
Outputs: {}
HitCount: []
TotalHits: 0
TotalMisses: 0
버전 내역
R2017a에 개발됨
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)