literate-dotfiles/docs/matlab.html
2022-05-09 10:05:23 +02:00

325 lines
14 KiB
HTML

<?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>
<!-- 2022-05-09 lun. 10:04 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Matlab Configuration</title>
<meta name="author" content="Dehaeze Thomas" />
<meta name="generator" content="Org Mode" />
<link rel="stylesheet" type="text/css" href="./dist/style.css"/>
<script type="text/javascript" src="./dist/script.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" class="content">
<h1 class="title">Matlab Configuration</h1>
<div id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
<li><a href="#orgc1c9b6e">Startup</a>
<ul>
<li><a href="#org46c0747">Setup LaTeX as a default interpreter</a></li>
<li><a href="#org75c8e73">Default Line Width</a></li>
<li><a href="#orgd61fc7b">Default grids on all axis</a></li>
<li><a href="#orgf3ae289">Default Font Size</a></li>
<li><a href="#orgb5d686c">Default Fonts</a></li>
<li><a href="#orgcdc2b07">Make figures into a Box</a></li>
<li><a href="#org9e8d7a5">Default Colors</a></li>
<li><a href="#org140426b">Default Plot Colors</a></li>
<li><a href="#org4b4a89b">Figure paper and window style</a></li>
<li><a href="#orgf6a9a64">Set the display format</a></li>
<li><a href="#org8f8b054">Home Path</a></li>
<li><a href="#orgff83ff5">Add to path</a></li>
<li><a href="#org03b369c">Clear</a></li>
</ul>
</li>
<li><a href="#org43c5113">Setup</a></li>
</ul>
</div>
</div>
<div id="outline-container-orgc1c9b6e" class="outline-2">
<h2 id="orgc1c9b6e">Startup</h2>
<div class="outline-text-2" id="text-orgc1c9b6e">
</div>
<div id="outline-container-org46c0747" class="outline-3">
<h3 id="org46c0747">Setup LaTeX as a default interpreter</h3>
<div class="outline-text-3" id="text-org46c0747">
<div class="org-src-container">
<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>);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultConstantLineInterpreter'</span>, <span class="org-string">'LaTeX'</span>);
</pre>
</div>
</div>
</div>
<div id="outline-container-org75c8e73" class="outline-3">
<h3 id="org75c8e73">Default Line Width</h3>
<div class="outline-text-3" id="text-org75c8e73">
<div class="org-src-container">
<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);
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd61fc7b" class="outline-3">
<h3 id="orgd61fc7b">Default grids on all axis</h3>
<div class="outline-text-3" id="text-orgd61fc7b">
<div class="org-src-container">
<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>);
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf3ae289" class="outline-3">
<h3 id="orgf3ae289">Default Font Size</h3>
<div class="outline-text-3" id="text-orgf3ae289">
<div class="org-src-container">
<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);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultConstantLineFontSize'</span>, 10);
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb5d686c" class="outline-3">
<h3 id="orgb5d686c">Default Fonts</h3>
<div class="outline-text-3" id="text-orgb5d686c">
<div class="org-src-container">
<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>);
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultConstantLineFontName'</span>, <span class="org-string">'Helvetica'</span>);
</pre>
</div>
</div>
</div>
<div id="outline-container-orgcdc2b07" class="outline-3">
<h3 id="orgcdc2b07">Make figures into a Box</h3>
<div class="outline-text-3" id="text-orgcdc2b07">
<div class="org-src-container">
<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>);
</pre>
</div>
</div>
</div>
<div id="outline-container-org9e8d7a5" class="outline-3">
<h3 id="org9e8d7a5">Default Colors</h3>
<div class="outline-text-3" id="text-org9e8d7a5">
<div class="org-src-container">
<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>);
<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>);
</pre>
</div>
</div>
</div>
<div id="outline-container-org140426b" class="outline-3">
<h3 id="org140426b">Default Plot Colors</h3>
<div class="outline-text-3" id="text-org140426b">
<div class="org-src-container">
<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>
<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])
</pre>
</div>
</div>
</div>
<div id="outline-container-org4b4a89b" class="outline-3">
<h3 id="org4b4a89b">Figure paper and window style</h3>
<div class="outline-text-3" id="text-org4b4a89b">
<div class="org-src-container">
<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>);
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf6a9a64" class="outline-3">
<h3 id="orgf6a9a64">Set the display format</h3>
<div class="outline-text-3" id="text-orgf6a9a64">
<div class="org-src-container">
<pre class="src src-matlab">format compact;
format long g;
</pre>
</div>
</div>
</div>
<div id="outline-container-org8f8b054" class="outline-3">
<h3 id="org8f8b054">Home Path</h3>
<div class="outline-text-3" id="text-org8f8b054">
<div class="org-src-container">
<pre class="src src-matlab">toolboxes_path = <span class="org-string">'~/Cloud/programming/matlab/'</span>;
</pre>
</div>
</div>
</div>
<div id="outline-container-orgff83ff5" class="outline-3">
<h3 id="orgff83ff5">Add to path</h3>
<div class="outline-text-3" id="text-orgff83ff5">
<p>
Provides <code>vecfig3</code> for FRF fitting (<a href="https://www.sintef.no/projectweb/vectorfitting/downloads/">link</a>).
</p>
<div class="org-src-container">
<pre class="src src-matlab">addpath([toolboxes_path <span class="org-string">'matrix_fitting_toolbox_1'</span>])
</pre>
</div>
<p>
Apply and save color schemes in MATLAB with ease (<a href="https://github.com/scottclowe/matlab-schemer">link</a>).
</p>
<div class="org-src-container">
<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>
<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>
<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">
<pre class="src src-matlab"><span class="org-comment-delimiter">% </span><span class="org-comment">addpath([toolboxes_path 'Hinf-Toolbox/src'])</span>
</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>])
</pre>
</div>
<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>
</div>
</div>
<div id="outline-container-org03b369c" class="outline-3">
<h3 id="org03b369c">Clear</h3>
<div class="outline-text-3" id="text-org03b369c">
<div class="org-src-container">
<pre class="src src-matlab">clear;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org43c5113" class="outline-2">
<h2 id="org43c5113">Setup</h2>
<div class="outline-text-2" id="text-org43c5113">
<p>
This script should be run once after Matlab is installed.
</p>
<p>
Import a nice color scheme.
</p>
<div class="org-src-container">
<pre class="src src-matlab">schemer_import(<span class="org-string">'~/Cloud/programming/matlab/matlab-schemer/schemes/monokai.prf'</span>);
</pre>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2022-05-09 lun. 10:04</p>
</div>
</body>
</html>