{ "cells": [ { "cell_type": "markdown", "id": "in-0", "metadata": {}, "source": [ "# numbl in the browser\n", "\n", "This is **numbl** (https://numbl.org) running as a JupyterLite kernel: MATLAB-syntax numerical\n", "computing that executes entirely in your browser tab. There is no server, no\n", "kernel process, and nothing to install.\n", "\n", "Run each cell with **Shift+Enter**. Variables persist from one cell to the\n", "next, just like a MATLAB session." ] }, { "cell_type": "markdown", "id": "in-1", "metadata": {}, "source": [ "## Compute with matrices" ] }, { "cell_type": "code", "execution_count": null, "id": "in-2", "metadata": {}, "outputs": [], "source": [ "A = magic(4)\n", "b = (1:4)';\n", "x = A \\ b;\n", "fprintf('solved a 4x4 system, residual = %.2e\\n', norm(A * x - b));" ] }, { "cell_type": "markdown", "id": "in-3", "metadata": {}, "source": [ "## Plot, right in the notebook" ] }, { "cell_type": "code", "execution_count": null, "id": "in-4", "metadata": {}, "outputs": [], "source": [ "x = linspace(0, 2 * pi, 400);\n", "plot(x, sin(x), 'b-');\n", "hold on;\n", "plot(x, sin(2 * x), 'r--');\n", "hold off;\n", "legend('sin(x)', 'sin(2x)');\n", "title('plotting works client-side');\n", "xlabel('x'); ylabel('y');" ] }, { "cell_type": "markdown", "id": "in-5", "metadata": {}, "source": [ "## 3-D figures are interactive (drag to rotate)" ] }, { "cell_type": "code", "execution_count": null, "id": "in-6", "metadata": {}, "outputs": [], "source": [ "surf(peaks(40));\n", "title('peaks');" ] }, { "cell_type": "markdown", "id": "in-7", "metadata": {}, "source": [ "## What's in this demo\n", "\n", "A guided tour of the language:\n", "\n", "1. [Data types and operators](./02-data-types-and-operators.ipynb)\n", "2. [Matrices and indexing](./03-matrices-and-indexing.ipynb)\n", "3. [Control flow and functions](./04-control-flow-and-functions.ipynb)\n", "4. [Linear algebra](./05-linear-algebra.ipynb)\n", "5. [Data structures and strings](./06-data-structures-and-strings.ipynb)\n", "6. [Numerical methods](./07-numerical-methods.ipynb)\n", "7. [Plotting gallery](./08-plotting.ipynb)\n", "\n", "Advanced MATLAB features:\n", "\n", "8. [Classes and object-oriented programming](./09-classes-and-oop.ipynb)\n", "9. [Namespaces and packages](./10-namespaces-and-packages.ipynb)\n", "\n", "And finally:\n", "\n", "10. [Installing packages with mip](./11-mip-packages.ipynb)" ] } ], "metadata": { "kernelspec": { "display_name": "numbl (MATLAB syntax)", "language": "numbl", "name": "numbl" }, "language_info": { "codemirror_mode": "octave", "file_extension": ".m", "mimetype": "text/x-octave", "name": "numbl", "nbconvert_exporter": "script", "pygments_lexer": "matlab" } }, "nbformat": 4, "nbformat_minor": 5 }