List all functions called in a piece of code

13 views
Skip to first unread message

Haifeng GONG

unread,
May 26, 2010, 6:45:03 PM5/26/10
to MathTools
profile on

% your code comes here


p = profile('info');

flag = zeros(length(p.FunctionTable), 1);

for ii=1:length(p.FunctionTable)
flag(ii) = (strcmp(p.FunctionTable(ii).FileName(1:32),
'code_folder'));
% code_folder --- where the functions are stored.
end

ft = p.FunctionTable(flag>0);

for ii=1:length(ft)
disp(ft(ii).FileName);
end

profile off

Reply all
Reply to author
Forward
0 new messages