literate-dotfiles/docs/matlab.html

325 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>
2022-05-09 10:05:23 +02:00
<!-- 2022-05-09 lun. 10:04 -->
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>
2022-05-09 10:05:23 +02:00
<li><a href="#orgc1c9b6e">Startup</a>
2020-01-12 17:40:59 +01:00
<ul>
2022-05-09 10:05:23 +02:00
<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>
2020-01-12 17:40:59 +01:00
</ul>
</li>
2022-05-09 10:05:23 +02:00
<li><a href="#org43c5113">Setup</a></li>
2020-01-12 17:40:59 +01:00
</ul>
</div>
</div>
2022-05-09 10:05:23 +02:00
<div id="outline-container-orgc1c9b6e" class="outline-2">
<h2 id="orgc1c9b6e">Startup</h2>
<div class="outline-text-2" id="text-orgc1c9b6e">
2020-01-12 17:40:59 +01:00
</div>
2022-05-09 10:05:23 +02:00
<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">
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>);
2022-05-09 10:05:23 +02:00
<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>);
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2022-05-09 10:05:23 +02:00
<div id="outline-container-org75c8e73" class="outline-3">
<h3 id="org75c8e73">Default Line Width</h3>
<div class="outline-text-3" id="text-org75c8e73">
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>
2022-05-09 10:05:23 +02:00
<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">
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>
2022-05-09 10:05:23 +02:00
<div id="outline-container-orgf3ae289" class="outline-3">
<h3 id="orgf3ae289">Default Font Size</h3>
<div class="outline-text-3" id="text-orgf3ae289">
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);
2022-05-09 10:05:23 +02:00
<span class="org-builtin">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultConstantLineFontSize'</span>, 10);
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2022-05-09 10:05:23 +02:00
<div id="outline-container-orgb5d686c" class="outline-3">
<h3 id="orgb5d686c">Default Fonts</h3>
<div class="outline-text-3" id="text-orgb5d686c">
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>);
2022-05-09 10:05:23 +02:00
<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>);
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2022-05-09 10:05:23 +02:00
<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">
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>
2022-05-09 10:05:23 +02:00
<div id="outline-container-org9e8d7a5" class="outline-3">
<h3 id="org9e8d7a5">Default Colors</h3>
<div class="outline-text-3" id="text-org9e8d7a5">
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>
2022-05-09 10:05:23 +02:00
<div id="outline-container-org140426b" class="outline-3">
<h3 id="org140426b">Default Plot Colors</h3>
<div class="outline-text-3" id="text-org140426b">
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>
2022-05-09 10:05:23 +02:00
<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">
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>
2022-05-09 10:05:23 +02:00
<div id="outline-container-orgf6a9a64" class="outline-3">
<h3 id="orgf6a9a64">Set the display format</h3>
<div class="outline-text-3" id="text-orgf6a9a64">
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>
2022-05-09 10:05:23 +02:00
<div id="outline-container-org8f8b054" class="outline-3">
<h3 id="org8f8b054">Home Path</h3>
<div class="outline-text-3" id="text-org8f8b054">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
2022-05-09 10:05:23 +02:00
<pre class="src src-matlab">toolboxes_path = <span class="org-string">'~/Cloud/programming/matlab/'</span>;
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
2022-05-09 10:05:23 +02:00
<div id="outline-container-orgff83ff5" class="outline-3">
<h3 id="orgff83ff5">Add to path</h3>
<div class="outline-text-3" id="text-orgff83ff5">
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>
2022-05-09 10:05:23 +02:00
<div id="outline-container-org03b369c" class="outline-3">
<h3 id="org03b369c">Clear</h3>
<div class="outline-text-3" id="text-org03b369c">
2020-01-12 17:40:59 +01:00
<div class="org-src-container">
<pre class="src src-matlab">clear;
</pre>
</div>
</div>
</div>
</div>
2022-05-09 10:05:23 +02:00
<div id="outline-container-org43c5113" class="outline-2">
<h2 id="org43c5113">Setup</h2>
<div class="outline-text-2" id="text-org43c5113">
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">
2022-05-09 10:05:23 +02:00
<pre class="src src-matlab">schemer_import(<span class="org-string">'~/Cloud/programming/matlab/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>
2022-05-09 10:05:23 +02:00
<p class="date">Created: 2022-05-09 lun. 10:04</p>
2020-01-12 17:40:59 +01:00
</div>
</body>
</html>