Files
B_Current_Ctrl/Matlab/utilities/setUpProject.m
T
2025-09-11 22:24:31 +08:00

20 lines
628 B
Matlab

function setUpProject()
%setUpProject Configure the environment for this project
%
% Set up the environment for the current project. This function is set to
% Run at Startup.
% Copyright 2013-2019 The MathWorks, Inc.
% Use Simulink Project API to get the current project:
p = slproject.getCurrentProject;
projectRoot = p.RootFolder;
% Set the location of slprj to be the "work" folder of the current project:
myCacheFolder = fullfile(projectRoot, 'work');
if ~exist(myCacheFolder, 'dir')
mkdir(myCacheFolder)
end
Simulink.fileGenControl('set', 'CacheFolder', myCacheFolder, ...
'CodeGenFolder', myCacheFolder);