Main Content

dependencies.fileDependencyAnalysis

Find model file dependencies

    Description

    files = dependencies.fileDependencyAnalysis('modelname') returns the full paths of all existing files referenced by the model modelname.

    [files,missing] = dependencies.fileDependencyAnalysis('modelname') also returns missing, any referenced files that cannot be found.

    [files,missing,depfile] = dependencies.fileDependencyAnalysis('modelname') also returns depfile, the full path of the user dependencies (.smd) file, if it exists, that stores the names of any files the user manually added or excluded.

    [files,missing,depfile,manifestfile] = dependencies.fileDependencyAnalysis('modelname','manifestfile') also creates a manifest file specified in manifestfile.

    Examples

    collapse all

    Open the project that contains the sldemo_mdlref_depraph model.

    openProject('ModelReferenceHierarchy');

    Programmatically find all the file dependencies of the sldemo_mdlref_depgraph model.

    files = dependencies.fileDependencyAnalysis('sldemo_mdlref_depgraph')
    files = 8x1 cell
        {'/tmp/Bdoc23b_2361005_2418446/tp20ed0645/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_F2C.slx'         }
        {'/tmp/Bdoc23b_2361005_2418446/tp20ed0645/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_depgraph.slx'    }
        {'/tmp/Bdoc23b_2361005_2418446/tp20ed0645/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_heat2cost.slx'   }
        {'/tmp/Bdoc23b_2361005_2418446/tp20ed0645/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_heater.slx'      }
        {'/tmp/Bdoc23b_2361005_2418446/tp20ed0645/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_house.slx'       }
        {'/tmp/Bdoc23b_2361005_2418446/tp20ed0645/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_outdoor_temp.slx'}
        {'/tmp/Bdoc23b_2361005_2418446/tp20ed0645/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_thermostat.slx'  }
        {'/tmp/Bdoc23b_2361005_2418446/tp20ed0645/simulink-ex05898741/ModelReferenceHierarchy/thermdat.m'                    }
    
    

    Input Arguments

    collapse all

    Full name or path of a model, library, or subsystem to analyze, specified as a character vector or string.

    Data Types: char | string

    (Optional) Full name or path of the manifest file to create, specified as a character vector or string. The function adds the suffix .smf to the user-specified name.

    Data Types: char | string

    Output Arguments

    collapse all

    Full paths of all existing files referenced by the model or library modelname, returned as a character vector or a cell array of character vectors.

    Full paths of files referenced by the model or library modelname that cannot be found, returned as a character vector or a cell array of character vectors.

    Full path of user dependencies (.smd) file, if it exists, that stores the names of any files the user manually added or excluded, returned as a character vector.

    Full path of new manifest (.smf) file, returned as a character vector.

    Tips

    Version History

    Introduced in R2012a

    expand all