6b31a9aSync .m workspace files from the notebook directory into the sessionJeremy Magland 2 "cells": [
3 {
4 "cell_type": "markdown",
9ff4e5bRestructure demo into a full guided tour with OOP and namespacesJeremy Magland 5 "id": "in-0",
6b31a9aSync .m workspace files from the notebook directory into the sessionJeremy Magland 6 "metadata": {},
8 "# numbl in the browser\n",
9 "\n",
10 "This is **numbl** (https://numbl.org) running as a JupyterLite kernel: MATLAB-syntax numerical\n",
11 "computing that executes entirely in your browser tab. There is no server, no\n",
12 "kernel process, and nothing to install.\n",
13 "\n",
14 "Run each cell with **Shift+Enter**. Variables persist from one cell to the\n",
15 "next, just like a MATLAB session."
16 ]
9ff4e5bRestructure demo into a full guided tour with OOP and namespacesJeremy Magland 19 "cell_type": "markdown",
20 "id": "in-1",
6b31a9aSync .m workspace files from the notebook directory into the sessionJeremy Magland 21 "metadata": {},
23 "## Compute with matrices"
24 ]
26 {
27 "cell_type": "code",
9ff4e5bRestructure demo into a full guided tour with OOP and namespacesJeremy Magland 29 "id": "in-2",
6b31a9aSync .m workspace files from the notebook directory into the sessionJeremy Magland 30 "metadata": {},
31 "outputs": [],
33 "A = magic(4)\n",
34 "b = (1:4)';\n",
35 "x = A \\ b;\n",
36 "fprintf('solved a 4x4 system, residual = %.2e\\n', norm(A * x - b));"
37 ]
39 {
9ff4e5bRestructure demo into a full guided tour with OOP and namespacesJeremy Magland 40 "cell_type": "markdown",
41 "id": "in-3",
6b31a9aSync .m workspace files from the notebook directory into the sessionJeremy Magland 42 "metadata": {},
44 "## Plot, right in the notebook"
45 ]
47 {
48 "cell_type": "code",
9ff4e5bRestructure demo into a full guided tour with OOP and namespacesJeremy Magland 50 "id": "in-4",
6b31a9aSync .m workspace files from the notebook directory into the sessionJeremy Magland 51 "metadata": {},
52 "outputs": [],
54 "x = linspace(0, 2 * pi, 400);\n",
55 "plot(x, sin(x), 'b-');\n",
56 "hold on;\n",
57 "plot(x, sin(2 * x), 'r--');\n",
58 "hold off;\n",
59 "legend('sin(x)', 'sin(2x)');\n",
60 "title('plotting works client-side');\n",
61 "xlabel('x'); ylabel('y');"
62 ]
64 {
65 "cell_type": "markdown",
9ff4e5bRestructure demo into a full guided tour with OOP and namespacesJeremy Magland 66 "id": "in-5",
67 "metadata": {},
69 "## 3-D figures are interactive (drag to rotate)"
70 ]
72 {
73 "cell_type": "code",
9ff4e5bRestructure demo into a full guided tour with OOP and namespacesJeremy Magland 75 "id": "in-6",
6b31a9aSync .m workspace files from the notebook directory into the sessionJeremy Magland 76 "metadata": {},
9ff4e5bRestructure demo into a full guided tour with OOP and namespacesJeremy Magland 77 "outputs": [],
79 "surf(peaks(40));\n",
80 "title('peaks');"
81 ]
83 {
84 "cell_type": "markdown",
9ff4e5bRestructure demo into a full guided tour with OOP and namespacesJeremy Magland 85 "id": "in-7",
6b31a9aSync .m workspace files from the notebook directory into the sessionJeremy Magland 86 "metadata": {},
88 "## What's in this demo\n",
89 "\n",
90 "A guided tour of the language:\n",
91 "\n",
92 "1. [Data types and operators](./02-data-types-and-operators.ipynb)\n",
93 "2. [Matrices and indexing](./03-matrices-and-indexing.ipynb)\n",
94 "3. [Control flow and functions](./04-control-flow-and-functions.ipynb)\n",
95 "4. [Linear algebra](./05-linear-algebra.ipynb)\n",
96 "5. [Data structures and strings](./06-data-structures-and-strings.ipynb)\n",
97 "6. [Numerical methods](./07-numerical-methods.ipynb)\n",
98 "7. [Plotting gallery](./08-plotting.ipynb)\n",
99 "\n",
100 "Advanced MATLAB features:\n",
101 "\n",
102 "8. [Classes and object-oriented programming](./09-classes-and-oop.ipynb)\n",
103 "9. [Namespaces and packages](./10-namespaces-and-packages.ipynb)\n",
104 "\n",
105 "And finally:\n",
106 "\n",
107 "10. [Installing packages with mip](./11-mip-packages.ipynb)"
108 ]
110 ],
111 "metadata": {
112 "kernelspec": {
f44f6a3Rebrand numbl-first: this runs numbl (which uses MATLAB syntax)Jeremy Magland 113 "display_name": "numbl (MATLAB syntax)",
114 "language": "numbl",
6b31a9aSync .m workspace files from the notebook directory into the sessionJeremy Magland 115 "name": "numbl"
116 },
117 "language_info": {
118 "codemirror_mode": "octave",
119 "file_extension": ".m",
120 "mimetype": "text/x-octave",
f44f6a3Rebrand numbl-first: this runs numbl (which uses MATLAB syntax)Jeremy Magland 121 "name": "numbl",
9ff4e5bRestructure demo into a full guided tour with OOP and namespacesJeremy Magland 122 "nbconvert_exporter": "script",
6b31a9aSync .m workspace files from the notebook directory into the sessionJeremy Magland 123 "pygments_lexer": "matlab"
124 }
125 },
126 "nbformat": 4,
127 "nbformat_minor": 5