| Contents | Index |
files=getSourcePaths(buildinfo, replaceMatlabroot, includeGroups, excludeGroups)
includeGroups and excludeGroups are optional.
Build information returned by RTW.BuildInfo.
The logical value true or false.
| If You Specify... | The Function... |
|---|---|
| true | Replaces the token $(MATLAB_ROOT) with the absolute path string for your MATLAB installation folder. |
| false | Does not replace the token $(MATLAB_ROOT). |
A character array or cell array of character arrays that specifies groups of source paths you want the function to return.
A character array or cell array of character arrays that specifies groups of source paths you do not want the function to return.
Paths of source files stored in the model's build information.
The getSourcePaths function returns the names of source file paths stored in the model's build information. Use the replaceMatlabroot argument to control whether the function includes your MATLAB root definition in the output it returns. Using optional includeGroups and excludeGroups arguments, you can selectively include or exclude groups of source file paths the function returns.
If you choose to specify excludeGroups and omit includeGroups, specify a null string ('') for includeGroups.
Get all source paths stored in build information myModelBuildInfo.
myModelBuildInfo = RTW.BuildInfo;
addSourcePaths(myModelBuildInfo, {'/proj/test1'...
'/proj/test2' '/drivers/src'}, {'tests' 'tests'...
'drivers'});
srcpaths=getSourcePaths(myModelBuildInfo, false);
srcpaths
srcpaths =
'\proj\test1' '\proj\test2' '\drivers\src'Get the paths in group tests that are stored in build information myModelBuildInfo.
myModelBuildInfo = RTW.BuildInfo;
addSourcePaths(myModelBuildInfo, {'/proj/test1'...
'/proj/test2' '/drivers/src'}, {'tests' 'tests'...
'drivers'});
srcpaths=getSourcePaths(myModelBuildInfo, true, 'tests');
srcpaths
srcpaths =
'\proj\test1' '\proj\test2' Get a path stored in build information myModelBuildInfo. First get the path without replacing $(MATLAB_ROOT) with an absolute path, then get it with replacement. The MATLAB root folder in this case is \\myserver\myworkspace\matlab.
myModelBuildInfo = RTW.BuildInfo;
addSourcePaths(myModelBuildInfo, fullfile(matlabroot,...
'rtw', 'c', 'src'));
srcpaths=getSourcePaths(myModelBuildInfo, false);
srcpaths{:}
ans =
$(MATLAB_ROOT)\rtw\c\src
srcpaths=getSourcePaths(myModelBuildInfo, true);
srcpaths{:}
ans =
\\myserver\myworkspace\matlab\rtw\c\srcaddSourcePaths | getIncludeFiles | getIncludePaths | getSourceFiles

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