www.gusucode.com > matlabxl 工具箱 matlab 源码程序 > matlabxl/getFileCustomData.m

    function data = getFileCustomData(filename)
% getFileCustomData returns the custom data in xml format for the given
% file
%
%   getFileCustomData is a utility for MATLAB Builder EX. This utility 
%   return returns the custom data for the given file in xml format. If
%   the file doesn't have any custom data, it returns NULL.
%   
%
%
%   SYNTAX:
%       getFileCustomData(filename)
%
%   USAGE:
%       getFileCustomData(filename)
%           Returns the custom data in xml format for the given
% file
%
%
%
% 
%
% Copyright 2010-2013, The MathWorks, Inc.
%

[pathstr,name,ext] = fileparts(filename);

filename = [name, ext];
if( isempty(pathstr) )
    filename = which(filename);
else
    filename = fullfile(pathstr,filename);   	
end

fws=com.mathworks.toolbox.compiler.services.FunctionWizardService.getInstance();
data=fws.getFileCustomData(filename);

end