| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink Design Optimization |
| Contents | Index |
| Learn more about Simulink Design Optimization |
dirs=finddepend(proj)
dirs=finddepend(proj) returns paths containing Simulink model dependencies required for parameter optimization using parallel computing. proj is a response optimization project for the model created using newsro or getsro. dirs is a cell array, where each element is a path string. dirs is empty when finddepend does not detect any model dependencies. Append paths to dirs when the list of paths is empty or incomplete.
finddepend does not return a complete list of model dependency paths when the dependencies are undetectable.
List model path dependencies required for parallel computing:
% Copy Simulink boiler library to temporary folder.
pathToLib = boilerpressure_setup;
% Add folder to search path.
addpath(pathToLib);
% Open Simulink model.
boilerpressure_demo
% Extract response optimization project.
proj=getsro('boilerpressure_demo');
% Enable parallel computing.
optimset(proj,'UseParallel','always');
% Get model dependency paths.
dirs=finddepend(proj)
% Add paths to optimization project.
optimset(proj,'ParallelPathDependencies',dirs)
Make local paths accessible to remote workers:
% Copy Simulink boiler library to temporary folder.
pathToLib = boilerpressure_setup;
% Add folder to search path.
addpath(pathToLib);
% Open Simulink model.
boilerpressure_demo
% Extract response optimization project.
proj=getsro('boilerpressure_demo');
% Enable parallel computing.
optimset(proj,'UseParallel','always');
% Get model dependency paths.
dirs=finddepend(proj)
% The resulting path is on a local drive, C:/.
% Replace C:/ with valid network path accessible to remote workers.
dirs = regexprep(dirs,'C:/','\\\\hostname\\C$\\')
% Add paths to optimization project.
optimset(proj,'ParallelPathDependencies',dirs)
Append path to model path dependency list:
% Copy Simulink boiler library to temporary folder.
pathToLib = boilerpressure_setup;
% Add folder to search path.
addpath(pathToLib);
% Open Simulink model.
boilerpressure_demo
% Extract response optimization project.
proj=getsro('boilerpressure_demo');
% Enable parallel computing.
optimset(proj,'UseParallel','always');
% Get model dependency paths.
dirs=finddepend(proj)
% Append an additional path.
dirs=vertcat(dirs,'\\hostname\C$\matlab\work')
% Add paths to optimization project.
optimset(proj,'ParallelPathDependencies',dirs)
Identify model path dependencies using the GUI:
In the Simulink model, double-click the Signal Constraint block to open the Block Parameters: Signal Constraint window.
In the Block Parameters window, select Optimization > Parallel Options to open the Parallel Options tab.
Select the Use the matlabpool during optimization option to identify the model dependencies automatically.
getsro | newsro | optimget | optimset
![]() | findconstr | findpar | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |