-
-
Notifications
You must be signed in to change notification settings - Fork 148
/
Copy pathmathlab.html
73 lines (53 loc) · 1.83 KB
/
mathlab.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title> mathlab interactive documentation</title>
<link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/app.klipse.tech/css/codemirror.css">
<link rel="stylesheet" type="text/css" href="https://viebel.github.io/klipse/css/main.css">
</head>
<body class="container">
<h1> mathlab interactive documentation</h1>
<p>The documentation is <strong>live</strong> and <strong>interactive</strong>
powered by the <a href="https://github.com/viebel/klipse">klipse plugin</a>:</p>
<ol>
<li><strong>Live</strong>: The code is executed in your browser</li>
<li><strong>Interactive</strong>: You can modify the code and it is evaluated as you type</li>
</ol>
<h2> Setup </h2>
First let's load <code>mathlab</code> from the <a href="https://github.com/timqian/mathlab">mathlab github repository</a> (It might take a couple of seconds...):
<br/>
<br/>
<pre><code class="js" data-external-libs="https://raw.githubusercontent.com/timqian/mathlab/master/dist/mathlab.min.js">
Object.keys(mathlab)
</code></pre>
<h2> Matrix Manipulation</h2>
<h3> Matrix inverse</h3>
<p>
<code>inv</code> calculates the inverse of a matrix.
</p>
<pre><code class="js">
mathlab.inv([[1,2],[3,4]])
</code></pre>
<p>And here is what happens when the matrix is not invertible:</p>
<pre><code class="js">
mathlab.inv([[1,2],[1,2]])
</code></pre>
<h2> Dot Product</h2>
<p>
<code>dot</code> calculates the dot product of a matrix.
</p>
<pre><code class="js">
mathlab.dot([[1, 1], [2, 1]], [1, 2])
</code></pre>
<script>
window.klipse_settings = {
selector_eval_js: '.js',
codemirror_options_out: {
lineWrapping: true
}
};
</script>
<script src="https://storage.googleapis.com/app.klipse.tech/plugin_prod/js/klipse_plugin.min.js"></script>
</body>
</html>