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 the full path of the user dependencies (.smd), if it exists, that stores the names of any files the user manually added or excluded.

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

    [___] = dependencies.fileDependencyAnalysis("modelname",Name=Value) specifies additional options as one or more name-value arguments.

    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/Bdoc24b_2725827_2865853/tp8ba5570f/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_F2C.slx'         }
        {'/tmp/Bdoc24b_2725827_2865853/tp8ba5570f/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_depgraph.slx'    }
        {'/tmp/Bdoc24b_2725827_2865853/tp8ba5570f/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_heat2cost.slx'   }
        {'/tmp/Bdoc24b_2725827_2865853/tp8ba5570f/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_heater.slx'      }
        {'/tmp/Bdoc24b_2725827_2865853/tp8ba5570f/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_house.slx'       }
        {'/tmp/Bdoc24b_2725827_2865853/tp8ba5570f/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_outdoor_temp.slx'}
        {'/tmp/Bdoc24b_2725827_2865853/tp8ba5570f/simulink-ex05898741/ModelReferenceHierarchy/sldemo_mdlref_thermostat.slx'  }
        {'/tmp/Bdoc24b_2725827_2865853/tp8ba5570f/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

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: dependencies.fileDependencyAnalysis("mymodel.slx",ManifestFile="manifestFileName",AnalyzeUnsavedModels=true)

    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

    Option to enable analyzing files that have unsaved changes, specified as a numeric or logical 1 (true) or 0 (false).

    Data Types: logical

    Option to enable analyzing files inside of toolboxes, specified as a numeric or logical 1 (true) or 0 (false).

    Data Types: logical

    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