nass-simscape/docs/simulink_project.html

96 lines
3.6 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2020-04-17 ven. 09:36 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Simulink Project for the NASS</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="Dehaeze Thomas" />
<link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
<script src="./js/jquery.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/jquery.stickytableheaders.min.js"></script>
<script src="./js/readtheorg.js"></script>
</head>
<body>
<div id="org-div-home-and-up">
<a accesskey="h" href="./index.html"> UP </a>
|
<a accesskey="H" href="./index.html"> HOME </a>
</div><div id="content">
<h1 class="title">Simulink Project for the NASS</h1>
<p>
Simulink Project is used for the study of the NASS using Simscape.
</p>
<p>
From the <a href="https://mathworks.com/products/simulink/projects.html">Simulink project</a> mathworks page:
</p>
<blockquote>
<p>
Simulink® and Simulink Projects provide a collaborative, scalable environment that enables teams to manage their files and data in one place.
</p>
<p>
With Simulink Projects, you can:
</p>
<ul class="org-ul">
<li><b>Collaborate</b>: Enforce companywide standards such as company tools, libraries, and standard startup and shutdown scripts. Share your work with rich sharing options including MATLAB® toolboxes, email, and archives.</li>
<li><b>Automate</b>: Set up your project environment correctly every time by automating steps such as loading the data, managing the path, and opening the models.</li>
<li><b>Integrate with source control</b>: Enable easy integration with source control and configuration management tools.</li>
</ul>
</blockquote>
<p>
The project can be opened using the <code>simulinkproject</code> function:
</p>
<div class="org-src-container">
<pre class="src src-matlab">simulinkproject(<span class="org-string">'./'</span>);
</pre>
</div>
<p>
When the project opens, a startup script is ran.
The startup script is defined below and is exported to the <code>project_startup.m</code> script.
</p>
<div class="org-src-container">
<pre class="src src-matlab">project = simulinkproject;
projectRoot = project.RootFolder;
myCacheFolder = fullfile(projectRoot, <span class="org-string">'.SimulinkCache'</span>);
myCodeFolder = fullfile(projectRoot, <span class="org-string">'.SimulinkCode'</span>);
Simulink.fileGenControl(<span class="org-string">'set'</span>,...
<span class="org-string">'CacheFolder'</span>, myCacheFolder,...
<span class="org-string">'CodeGenFolder'</span>, myCodeFolder,...
<span class="org-string">'createDir'</span>, <span class="org-constant">true</span>);
<span class="org-matlab-cellbreak"><span class="org-comment">%% Load the Simscape Configuration</span></span>
load(<span class="org-string">'mat/conf_simulink.mat'</span>);
</pre>
</div>
<p>
When the project closes, it runs the <code>project_shutdown.m</code> script defined below.
</p>
<div class="org-src-container">
<pre class="src src-matlab">Simulink.fileGenControl(<span class="org-string">'reset'</span>);
</pre>
</div>
<p>
The project also permits to automatically add defined folder to the path when the project is opened.
</p>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2020-04-17 ven. 09:36</p>
</div>
</body>
</html>