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

    Programmatically find all the file dependencies of the model sldemo_mdlref_depgraph.

    files = dependencies.fileDependencyAnalysis('sldemo_mdlref_depgraph')
    files = 7x1 cell
        {'/tmp/Bdoc20b_1498024_125808/tp84073275/simulink-ex05898741/sldemo_mdlref_F2C.slx'         }
        {'/tmp/Bdoc20b_1498024_125808/tp84073275/simulink-ex05898741/sldemo_mdlref_depgraph.slx'    }
        {'/tmp/Bdoc20b_1498024_125808/tp84073275/simulink-ex05898741/sldemo_mdlref_heat2cost.slx'   }
        {'/tmp/Bdoc20b_1498024_125808/tp84073275/simulink-ex05898741/sldemo_mdlref_heater.slx'      }
        {'/tmp/Bdoc20b_1498024_125808/tp84073275/simulink-ex05898741/sldemo_mdlref_house.slx'       }
        {'/tmp/Bdoc20b_1498024_125808/tp84073275/simulink-ex05898741/sldemo_mdlref_outdoor_temp.slx'}
        {'/tmp/Bdoc20b_1498024_125808/tp84073275/simulink-ex05898741/sldemo_mdlref_thermostat.slx'  }
    
    

    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

    Compatibility Considerations

    expand all

    Not recommended starting in R2020b

    Introduced in R2012a