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);

답변 (2개)

KSSV
KSSV 2021년 12월 30일

0 개 추천

N = 100;
A = rand(N, N);
b = rand(N, 1);
mem1 = A \ b ;
mem2 = sparse(A) \ b ;
whos mem1 mem2
Name Size Bytes Class Attributes mem1 100x1 800 double mem2 100x1 800 double

카테고리

도움말 센터File Exchange에서 Linear Algebra에 대해 자세히 알아보기

제품

릴리스

R2020b

태그

질문:

2021년 12월 30일

답변:

2021년 12월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by