MATLAB Answers

John Doe

Profiling for cells instead of functions

Asked by John Doe
on 12 May 2013

I have a function that in turn calls many more functions. I want to use the profiler to identify what parts of the code is most time demanding.

Is it possible to get the profile summary sorted by cells, instead of function calls?

For instance, is it possible to get the profiler to output this:

Cells    Calls   Total time ...  
Part 1       1         .... ...
Part 2       1         .... ...

instead of:

Function name   Calls   Total time ...  
func1               1         .... ...
func2               1         .... ...

For the following code:

%% Part 1:
a = 1;
b = 2;
X = func1(a,b);
%% Part 2:
c = a+b;
Y = func2(c,b);




No products are associated with this question.

1 Answer

Answer by the cyclist
on 12 May 2013
Edited by the cyclist
on 12 May 2013

I looked through

>> doc profile

and also some articles here:

and did not see any mention of that ability.


John Doe
on 12 May 2013

Thanks for checking it out! I'll manage it some other way then =)

the cyclist
on 12 May 2013

I guess you could artificially put your cells into functions for profiling, but that just seems silly. :-)

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today