How to use profiler to calculate the number of matrix multiplications

조회 수: 2 (최근 30일)
Siyomnqoba
Siyomnqoba 2015년 10월 21일
댓글: the cyclist 2015년 10월 21일
I have wrote the followin simple matlab program to simulate a more compex matrix multiplication I am doing.
A = randi(10,10);
B = randi(10,10);
profile on-history
c = A*B;
profile('info')
but from this all I'm getting:
FunctionTable: [0x1 struct] FunctionHistory: [2x0 double] ClockPrecision: 1.0000e-03 ClockSpeed: 3.2010e+09 Name: 'MATLAB' Overhead: 0
This doesn't seem to tell me,I'm looking for a way that'll tell me the number of additions and matrix multiplications since what I am doing is far bigger than what I have here and cannot be computed manually.

답변 (1개)

the cyclist
the cyclist 2015년 10월 21일
I think you want the profile viewer instead:
A = randi(10,10);
B = randi(10,10);
profile on -history
c = A*B;
profile viewer
  댓글 수: 2
Siyomnqoba
Siyomnqoba 2015년 10월 21일
It doesn't seem to tell me much either:
the cyclist
the cyclist 2015년 10월 21일
Profiling is designed for functions, so I suggest the following. Create a function such as this:
function [] = answerTest()
N = 3000;
A = randi(N,N);
B = randi(N,N);
c = A*B;
end
and then profile the function:
profile on; answerTest(); profile viewer
In the profiler, if you expand the answerTest link, you should see something like the attached screenshot.
%

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by