literate-dotfiles/docs/matlab.html

322 lines
14 KiB
HTML
Raw Permalink Normal View History

2020-01-12 17:40:59 +01:00
<?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>
2021-10-25 14:37:10 +02:00
<!-- 2021-10-25 lun. 14:33 -->
2020-01-12 17:40:59 +01:00
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Matlab Configuration</title>
<meta name="author" content="Dehaeze Thomas" />
2021-10-25 14:37:10 +02:00
<meta name="generator" content="Org Mode" />
2021-01-01 20:12:34 +01:00
<link rel="stylesheet" type="text/css" href="./dist/style.css"/>
<script type="text/javascript" src="./dist/script.js"></script>
2020-01-12 17:40:59 +01:00
</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>
2021-10-25 14:37:10 +02:00
</div><div id="content" class="content">
2020-01-12 17:40:59 +01:00
<h1 class="title">Matlab Configuration</h1>
2021-10-25 14:37:10 +02:00
<div id="table-of-contents" role="doc-toc">
2020-01-12 17:40:59 +01:00
<h2>Table of Contents</h2>
2021-10-25 14:37:10 +02:00
<div id="text-table-of-contents" role="doc-toc">
2020-01-12 17:40:59 +01:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#orga81f527">Startup</a>
2020-01-12 17:40:59 +01:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#orgadff39b">Setup LaTeX as a default interpreter</a></li>
<li><a href="#orga7cc243">Default Line Width</a></li>
<li><a href="#org9bcf5b6">Default grids on all axis</a></li>
<li><a href="#orgcda5566">Default Font Size</a></li>
<li><a href="#org0a7bfe6">Default Fonts</a></li>
<li><a href="#orgced64b8">Make figures into a Box</a></li>
<li><a href="#org731843c">Default Colors</a></li>
<li><a href="#orgc91b474">Default Plot Colors</a></li>
<li><a href="#orgc0980a1">Figure paper and window style</a></li>
<li><a href="#org7ed9ec6">Set the display format</a></li>
<li><a href="#orgafda72c">Home Path</a></li>
<li><a href="#orgfcd649d">Add to path</a></li>
<li><a href="#org1b5f37b">Clear</a></li>
2020-01-12 17:40:59 +01:00
</ul>
</li>
2021-01-01 20:12:34 +01:00
<li><a href="#orgfcee066">Setup</a></li>
2020-01-12 17:40:59 +01:00
</ul>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orga81f527" class="outline-2">
<h2 id="orga81f527">Startup</h2>
<div class="outline-text-2" id="text-orga81f527">
2020-01-12 17:40:59 +01:00
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgadff39b" class="outline-3">
<h3 id="orgadff39b">Setup LaTeX as a default interpreter</h3>
<div class="outline-text-3" id="text-orgadff39b">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2021-10-25 14:37:10 +02:00
<pre class="src src-matlab"><span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultTextInterpreter'</span>, <span class="org-string">'LaTeX'</span>);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesTickLabelInterpreter'</span>, <span class="org-string">'LaTeX'</span>);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesFontName'</span>, <span class="org-string">'LaTeX'</span>);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultLegendInterpreter'</span>, <span class="org-string">'LaTeX'</span>);
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orga7cc243" class="outline-3">
<h3 id="orga7cc243">Default Line Width</h3>
<div class="outline-text-3" id="text-orga7cc243">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2021-10-25 14:37:10 +02:00
<pre class="src src-matlab"><span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultLineLineWidth'</span>, 1.5);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesLineWidth'</span>, 0.5);
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org9bcf5b6" class="outline-3">
<h3 id="org9bcf5b6">Default grids on all axis</h3>
<div class="outline-text-3" id="text-org9bcf5b6">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2021-10-25 14:37:10 +02:00
<pre class="src src-matlab"><span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesXGrid'</span>,<span class="org-string">'on'</span>);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesYGrid'</span>,<span class="org-string">'on'</span>);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesZGrid'</span>,<span class="org-string">'on'</span>);
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgcda5566" class="outline-3">
<h3 id="orgcda5566">Default Font Size</h3>
<div class="outline-text-3" id="text-orgcda5566">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2021-10-25 14:37:10 +02:00
<pre class="src src-matlab"><span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultTextFontUnits'</span>, <span class="org-string">'points'</span>);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultTextFontSize'</span>, 10);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesFontUnits'</span>, <span class="org-string">'points'</span>);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesFontSize'</span>, 10);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultUicontrolFontSize'</span>, 10);
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org0a7bfe6" class="outline-3">
<h3 id="org0a7bfe6">Default Fonts</h3>
<div class="outline-text-3" id="text-org0a7bfe6">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2021-10-25 14:37:10 +02:00
<pre class="src src-matlab"><span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesFontName'</span>, <span class="org-string">'Helvetica'</span>);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultTextFontName'</span>, <span class="org-string">'Helvetica'</span>);
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgced64b8" class="outline-3">
<h3 id="orgced64b8">Make figures into a Box</h3>
<div class="outline-text-3" id="text-orgced64b8">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2021-10-25 14:37:10 +02:00
<pre class="src src-matlab"><span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesBox'</span>, <span class="org-string">'on'</span>);
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org731843c" class="outline-3">
<h3 id="org731843c">Default Colors</h3>
<div class="outline-text-3" id="text-org731843c">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2021-10-25 14:37:10 +02:00
<pre class="src src-matlab"><span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesColor'</span>, <span class="org-string">'w'</span>);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesXColor'</span>, <span class="org-string">'k'</span>);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesYColor'</span>, <span class="org-string">'k'</span>);
2020-01-12 17:40:59 +01:00
2021-10-25 14:37:10 +02:00
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultFigureColor'</span>, <span class="org-string">'w'</span>);
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgc91b474" class="outline-3">
<h3 id="orgc91b474">Default Plot Colors</h3>
<div class="outline-text-3" id="text-orgc91b474">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2021-10-25 14:37:10 +02:00
<pre class="src src-matlab">c1 = [ 0 0.4470 0.7410]; <span class="org-comment-delimiter">% </span><span class="org-comment">Blue</span>
c2 = [0.8500 0.3250 0.0980]; <span class="org-comment-delimiter">% </span><span class="org-comment">Orange</span>
c3 = [0.9290 0.6940 0.1250]; <span class="org-comment-delimiter">% </span><span class="org-comment">Yellow</span>
c4 = [0.4940 0.1840 0.5560]; <span class="org-comment-delimiter">% </span><span class="org-comment">Purple</span>
c5 = [0.4660 0.6740 0.1880]; <span class="org-comment-delimiter">% </span><span class="org-comment">Green</span>
c6 = [0.3010 0.7450 0.9330]; <span class="org-comment-delimiter">% </span><span class="org-comment">Light Blue</span>
c7 = [0.6350 0.0780 0.1840]; <span class="org-comment-delimiter">% </span><span class="org-comment">Red</span>
2020-01-12 17:40:59 +01:00
2021-10-25 14:37:10 +02:00
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'defaultAxesColorOrder'</span>, [c1; c2; c3; c4; c5; c6; c7])
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgc0980a1" class="outline-3">
<h3 id="orgc0980a1">Figure paper and window style</h3>
<div class="outline-text-3" id="text-orgc0980a1">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2021-10-25 14:37:10 +02:00
<pre class="src src-matlab"><span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultFigurePaperType'</span>, <span class="org-string">'A4'</span>);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultFigureWindowStyle'</span>, <span class="org-string">'normal'</span>);
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org7ed9ec6" class="outline-3">
<h3 id="org7ed9ec6">Set the display format</h3>
<div class="outline-text-3" id="text-org7ed9ec6">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
<pre class="src src-matlab">format compact;
format long g;
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgafda72c" class="outline-3">
<h3 id="orgafda72c">Home Path</h3>
<div class="outline-text-3" id="text-orgafda72c">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-matlab">toolboxes_path = <span class="org-string">'~/Cloud/thesis/matlab/toolboxes/'</span>;
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgfcd649d" class="outline-3">
<h3 id="orgfcd649d">Add to path</h3>
<div class="outline-text-3" id="text-orgfcd649d">
2020-11-03 16:27:09 +01:00
<p>
Provides <code>vecfig3</code> for FRF fitting (<a href="https://www.sintef.no/projectweb/vectorfitting/downloads/">link</a>).
</p>
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-matlab">addpath([toolboxes_path <span class="org-string">'matrix_fitting_toolbox_1'</span>])
2020-01-12 17:40:59 +01:00
</pre>
</div>
2020-11-03 16:27:09 +01:00
<p>
Apply and save color schemes in MATLAB with ease (<a href="https://github.com/scottclowe/matlab-schemer">link</a>).
</p>
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-matlab">addpath([toolboxes_path <span class="org-string">'matlab-schemer'</span>])
</pre>
</div>
<p>
Converts MATLAB figures to TikZ (<a href="https://github.com/matlab2tikz/matlab2tikz">link</a>).
</p>
<div class="org-src-container">
<pre class="src src-matlab">addpath([toolboxes_path <span class="org-string">'matlab2tikz/src'</span>])
</pre>
</div>
2021-10-25 14:37:10 +02:00
<p>
Working with Tensors (<a href="https://www.tensorlab.net/">link</a>).
</p>
<div class="org-src-container">
<pre class="src src-matlab">addpath([toolboxes_path <span class="org-string">'tensorlab'</span>])
</pre>
</div>
2020-11-03 16:27:09 +01:00
<p>
MATLAB toolbox for exporting publication quality figures (<a href="https://github.com/altmany/export_fig">link</a>).
</p>
<div class="org-src-container">
<pre class="src src-matlab">addpath([toolboxes_path <span class="org-string">'export_fig'</span>])
</pre>
</div>
<p>
MATLAB source code formatter, beautifier (<a href="https://github.com/davidvarga/MBeautifier">link</a>).
</p>
<div class="org-src-container">
<pre class="src src-matlab">addpath([toolboxes_path <span class="org-string">'MBeautifier'</span>])
</pre>
</div>
<p>
Toolbox for Convex Programming (<a href="http://cvxr.com/cvx/">link</a>).
</p>
<div class="org-src-container">
<pre class="src src-matlab">addpath([toolboxes_path <span class="org-string">'CVX'</span>])
</pre>
</div>
<p>
Useful functions to use with <code>orgmode</code> (<a href="https://github.com/tdehaeze/Org-Mode-Matlab">link</a>).
</p>
<div class="org-src-container">
<pre class="src src-matlab">addpath([toolboxes_path <span class="org-string">'Org-Mode-Toolbox/src'</span>])
</pre>
</div>
<p>
Some useful function (<a href="https://github.com/tdehaeze/matlab_useful_functions">link</a>).
</p>
<div class="org-src-container">
<pre class="src src-matlab">addpath([toolboxes_path <span class="org-string">'matlab_useful_functions/src'</span>])
</pre>
</div>
<p>
H-Infinity Toolbox (<a href="https://github.com/tdehaeze/hinf-toolbox">link</a>).
</p>
<div class="org-src-container">
2021-10-25 14:37:10 +02:00
<pre class="src src-matlab"><span class="org-comment-delimiter">% </span><span class="org-comment">addpath([toolboxes_path 'Hinf-Toolbox/src'])</span>
2020-11-03 16:27:09 +01:00
</pre>
</div>
<p>
Toolbox to work with Finite Element Models (<a href="https://github.com/tdehaeze/fem_matlab_toolbox">link</a>).
</p>
<div class="org-src-container">
<pre class="src src-matlab">addpath([toolboxes_path <span class="org-string">'fem_toolbox/src'</span>])
2020-01-12 17:40:59 +01:00
</pre>
</div>
2021-01-01 20:12:34 +01:00
<p>
Toolbox to work with fractional order models (<a href="https://github.com/extall/fomcon-matlab">link</a>).
</p>
<div class="org-src-container">
<pre class="src src-matlab">addpath(genpath([toolboxes_path <span class="org-string">'fomcon-matlab'</span>]))
</pre>
</div>
2020-01-12 17:40:59 +01:00
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org1b5f37b" class="outline-3">
<h3 id="org1b5f37b">Clear</h3>
<div class="outline-text-3" id="text-org1b5f37b">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
<pre class="src src-matlab">clear;
</pre>
</div>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgfcee066" class="outline-2">
<h2 id="orgfcee066">Setup</h2>
<div class="outline-text-2" id="text-orgfcee066">
2020-11-03 16:27:09 +01:00
<p>
This script should be run once after Matlab is installed.
</p>
2020-01-12 17:40:59 +01:00
2020-11-03 16:27:09 +01:00
<p>
Import a nice color scheme.
</p>
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-matlab">schemer_import(<span class="org-string">'~/Cloud/thesis/matlab/toolboxes/Add-Ons/matlab-schemer/schemes/monokai.prf'</span>);
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
2021-10-25 14:37:10 +02:00
<p class="date">Created: 2021-10-25 lun. 14:33</p>
2020-01-12 17:40:59 +01:00
</div>
</body>
</html>