Main Content

frest.findDepend

Namespace: frest

List of model path dependencies

Syntax

dirs = frest.findDepend(model)

Description

dirs = frest.findDepend(model) returns paths containing Simulink® model dependencies required for frequency response estimation using parallel computing. model is the Simulink model to estimate, specified as a character vector or a string. dirs is a cell array, where each element is a path character vector. dirs is empty when frest.findDepend does not detect any model dependencies. Append paths to dirs when the list of paths is empty or incomplete.

frest.findDepend does not return a complete list of model dependency paths when the dependencies are undetectable.

Examples

collapse all

To demonstrate a dependency on a file that is not in the current working folder, move the model files to a temporary folder and return the path to that folder. The pathdepSetup helper function also adds the temporary folder to the MATLAB® search path.

tempPath = pathdepSetup;

Open the Simulink® model.

mdl = 'scdpathdep';
open_system(mdl)

Obtain the model dependency path.

dirs = frest.findDepend(mdl)
dirs = 1×1 cell array
    {'C:/myTempFiles/tpd02d55f5_8b4c_489e_938c_ea004b9c771d'}

The resulting path is on the local drive C:/.

If you are using remote workers, specify that all workers can access your local drive. For example, this command converts all references to the C drive to an equivalent network address that is accessible to remote workers.

dirs = regexprep(dirs,'C:/','\\\\hostname\\C$\\')

Enable parallel computing and specify the model path dependencies.

options = frestimateOptions(...
    'UseParallel','on',...
    'ParallelPathDependencies',dirs);

You can now use these options for frequency response estimation using parallel computing.

io = getlinio(mdl);
in = frest.Sinestream('SimulationOrder','OneAtATime');
frd = frestimate(mdl,io,in,options);

After estimating the frequency response, you can close the model.

bdclose(mdl)

Return the model files to the current working folder and remove the temporary folder from the path.

pathdepCleanup(tempPath)

Version History

Introduced in R2010a