literate-dotfiles/docs/matlab.html

310 lines
13 KiB
HTML
Raw 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>
2020-11-03 16:27:09 +01:00
<!-- 2020-11-03 mar. 16:26 -->
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="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 type="text/javascript" src="./js/jquery.min.js"></script>
<script type="text/javascript" src="./js/bootstrap.min.js"></script>
<script type="text/javascript" src="./js/jquery.stickytableheaders.min.js"></script>
<script type="text/javascript" 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">Matlab Configuration</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org157998a">Startup</a>
<ul>
<li><a href="#orgf6d1f33">Setup LaTeX as a default interpreter</a></li>
<li><a href="#org4d6a4e5">Default Line Width</a></li>
<li><a href="#org14081cd">Default grids on all axis</a></li>
<li><a href="#org3406bd4">Default Font Size</a></li>
<li><a href="#org6451de0">Default Fonts</a></li>
<li><a href="#orgad9e350">Make figures into a Box</a></li>
<li><a href="#org9a40d31">Default Colors</a></li>
<li><a href="#org64d60de">Default Plot Colors</a></li>
<li><a href="#org27ce6db">Figure paper and window style</a></li>
<li><a href="#orgd711b41">Set the display format</a></li>
<li><a href="#orga60f640">Home Path</a></li>
<li><a href="#org83d6337">Add to path</a></li>
<li><a href="#orgbc34538">Clear</a></li>
</ul>
</li>
2020-11-03 16:27:09 +01:00
<li><a href="#org20ac1e5">Setup</a></li>
2020-01-12 17:40:59 +01:00
</ul>
</div>
</div>
<div id="outline-container-org157998a" class="outline-2">
<h2 id="org157998a">Startup</h2>
<div class="outline-text-2" id="text-org157998a">
</div>
<div id="outline-container-orgf6d1f33" class="outline-3">
<h3 id="orgf6d1f33">Setup LaTeX as a default interpreter</h3>
<div class="outline-text-3" id="text-orgf6d1f33">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-matlab"><span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultTextInterpreter'</span>, <span class="org-string">'LaTeX'</span>);
<span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesTickLabelInterpreter'</span>, <span class="org-string">'LaTeX'</span>);
<span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesFontName'</span>, <span class="org-string">'LaTeX'</span>);
<span class="org-type">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>
<div id="outline-container-org4d6a4e5" class="outline-3">
<h3 id="org4d6a4e5">Default Line Width</h3>
<div class="outline-text-3" id="text-org4d6a4e5">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-matlab"><span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultLineLineWidth'</span>, 1.5);
<span class="org-type">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>
<div id="outline-container-org14081cd" class="outline-3">
<h3 id="org14081cd">Default grids on all axis</h3>
<div class="outline-text-3" id="text-org14081cd">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-matlab"><span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesXGrid'</span>,<span class="org-string">'on'</span>);
<span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesYGrid'</span>,<span class="org-string">'on'</span>);
<span class="org-type">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>
<div id="outline-container-org3406bd4" class="outline-3">
<h3 id="org3406bd4">Default Font Size</h3>
<div class="outline-text-3" id="text-org3406bd4">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-matlab"><span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultTextFontUnits'</span>, <span class="org-string">'points'</span>);
<span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultTextFontSize'</span>, 10);
<span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesFontUnits'</span>, <span class="org-string">'points'</span>);
<span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesFontSize'</span>, 10);
<span class="org-type">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>
<div id="outline-container-org6451de0" class="outline-3">
<h3 id="org6451de0">Default Fonts</h3>
<div class="outline-text-3" id="text-org6451de0">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-matlab"><span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesFontName'</span>, <span class="org-string">'Helvetica'</span>);
<span class="org-type">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>
<div id="outline-container-orgad9e350" class="outline-3">
<h3 id="orgad9e350">Make figures into a Box</h3>
<div class="outline-text-3" id="text-orgad9e350">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-matlab"><span class="org-type">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>
<div id="outline-container-org9a40d31" class="outline-3">
<h3 id="org9a40d31">Default Colors</h3>
<div class="outline-text-3" id="text-org9a40d31">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-matlab"><span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesColor'</span>, <span class="org-string">'w'</span>);
<span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultAxesXColor'</span>, <span class="org-string">'k'</span>);
<span class="org-type">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
2020-11-03 16:27:09 +01:00
<span class="org-type">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>
<div id="outline-container-org64d60de" class="outline-3">
<h3 id="org64d60de">Default Plot Colors</h3>
<div class="outline-text-3" id="text-org64d60de">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-matlab">c1 = [ 0 0.4470 0.7410]; <span class="org-comment">% Blue</span>
c2 = [0.8500 0.3250 0.0980]; <span class="org-comment">% Orange</span>
c3 = [0.9290 0.6940 0.1250]; <span class="org-comment">% Yellow</span>
c4 = [0.4940 0.1840 0.5560]; <span class="org-comment">% Purple</span>
c5 = [0.4660 0.6740 0.1880]; <span class="org-comment">% Green</span>
c6 = [0.3010 0.7450 0.9330]; <span class="org-comment">% Light Blue</span>
c7 = [0.6350 0.0780 0.1840]; <span class="org-comment">% Red</span>
2020-01-12 17:40:59 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-type">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>
<div id="outline-container-org27ce6db" class="outline-3">
<h3 id="org27ce6db">Figure paper and window style</h3>
<div class="outline-text-3" id="text-org27ce6db">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-matlab"><span class="org-type">set</span>(<span class="org-variable-name">groot</span>, <span class="org-string">'DefaultFigurePaperType'</span>, <span class="org-string">'A4'</span>);
<span class="org-type">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>
<div id="outline-container-orgd711b41" class="outline-3">
<h3 id="orgd711b41">Set the display format</h3>
<div class="outline-text-3" id="text-orgd711b41">
<div class="org-src-container">
<pre class="src src-matlab">format compact;
format long g;
</pre>
</div>
</div>
</div>
<div id="outline-container-orga60f640" class="outline-3">
<h3 id="orga60f640">Home Path</h3>
<div class="outline-text-3" id="text-orga60f640">
<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>
<div id="outline-container-org83d6337" class="outline-3">
<h3 id="org83d6337">Add to path</h3>
<div class="outline-text-3" id="text-org83d6337">
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>
<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">% 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>])
2020-01-12 17:40:59 +01:00
</pre>
</div>
</div>
</div>
<div id="outline-container-orgbc34538" class="outline-3">
<h3 id="orgbc34538">Clear</h3>
<div class="outline-text-3" id="text-orgbc34538">
<div class="org-src-container">
<pre class="src src-matlab">clear;
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org20ac1e5" class="outline-2">
<h2 id="org20ac1e5">Setup</h2>
<div class="outline-text-2" id="text-org20ac1e5">
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>
2020-11-03 16:27:09 +01:00
<p class="date">Created: 2020-11-03 mar. 16:26</p>
2020-01-12 17:40:59 +01:00
</div>
</body>
</html>