/ concept-collection / jupyterlite-numbl-kernel
Sign in
concept-collection / jupyterlite-numbl-kernel
jupyterlite-numbl-kernel / demo / content / 01-intro.ipynb
128 lines · 3.1 KBCodeBlameHistory
3 {
4 "cell_type": "markdown",
2c57b11add numbl linkJeremy Magland 7 "source": [
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",
2c57b11add numbl linkJeremy Magland 22 "source": [
23 "## Compute with matrices"
24 ]
26 {
27 "cell_type": "code",
2c57b11add numbl linkJeremy Magland 28 "execution_count": null,
31 "outputs": [],
2c57b11add numbl linkJeremy Magland 32 "source": [
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",
2c57b11add numbl linkJeremy Magland 43 "source": [
44 "## Plot, right in the notebook"
45 ]
47 {
48 "cell_type": "code",
2c57b11add numbl linkJeremy Magland 49 "execution_count": null,
52 "outputs": [],
2c57b11add numbl linkJeremy Magland 53 "source": [
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",
67 "metadata": {},
2c57b11add numbl linkJeremy Magland 68 "source": [
69 "## 3-D figures are interactive (drag to rotate)"
70 ]
72 {
73 "cell_type": "code",
2c57b11add numbl linkJeremy Magland 74 "execution_count": null,
2c57b11add numbl linkJeremy Magland 78 "source": [
79 "surf(peaks(40));\n",
80 "title('peaks');"
81 ]
83 {
84 "cell_type": "markdown",
2c57b11add numbl linkJeremy Magland 87 "source": [
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",
116 },
117 "language_info": {
118 "codemirror_mode": "octave",
119 "file_extension": ".m",
120 "mimetype": "text/x-octave",
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
moveopenescclose