0

I'm trying to track down all user-created functions and scripts within lenghty MATLAB code. The following code does this but due to MATLAB's profiler's default history size of 1,000,000 I'm missing a good amount of functions.

function endProfile(p)

    profile off
    diary('Diary_endProfile')
    for k = 1:size(p.FunctionHistory, 2)

        if p.FunctionHistory(1, k) == 0
            str = 'entering function: ';
        else
            str = 'exiting function: ';
        end

        if isempty(strfind(p.FunctionTable(p.FunctionHistory(2,k)).FileName, 'C:\Program Files\MATLAB\')) &&...
           ~strcmp(p.FunctionTable(p.FunctionHistory(2, k)).FileName, '')
            disp([str p.FunctionTable(p.FunctionHistory(2, k)).FunctionName])
        end
    end

    profile off
    profile viewer

end

I initialize the profiler with the following code from the first script of the code under analysis:

profile clear

profile on -history -historysize 1000000000

The previous function is called at the end of the first script as follows:

endProfile(profile('info'))

Does anyone know what the maximum history size is and/or if there are alternate ways of increasing the size?

Thanks!

4

1 回答 1

0

查看依赖关系的更好方法是使用depfun或来自 File Exchange的优秀fdep 。

于 2012-09-25T13:54:29.950 回答