Memory usage of a function
조회 수: 23 (최근 30일)
이전 댓글 표시
I am trying to measure the memory usage of a function. I would like to compare the memory requirements for different methods of solving a linear system of equations. I am looking for a way of measuring it like this:
N = 100;
A = rand(N, N);
b = rand(N, 1);
mem1 = memory(sol = A \ b);
mem2 = memory(sol = sparse(A) \ b);
댓글 수: 0
답변 (2개)
KSSV
2021년 12월 30일
N = 100;
A = rand(N, N);
b = rand(N, 1);
mem1 = A \ b ;
mem2 = sparse(A) \ b ;
whos mem1 mem2
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!