{ "cells": [ { "cell_type": "markdown", "id": "mp-0", "metadata": {}, "source": "# Installing packages with mip\n\nnumbl ships with `mip`, a package manager for numbl packages. Packages are\nfetched from GitHub releases and cached in your browser's IndexedDB, so the\ndownload happens once.\n\nThe first cell you run in a session also bootstraps the engine, so expect a\nshort delay (progress is printed). These cells reach the network, so they are\nnot part of the offline verification suite." }, { "cell_type": "code", "id": "mp-1", "metadata": {}, "execution_count": null, "outputs": [], "source": "mip load --install chebfun" }, { "cell_type": "markdown", "id": "mp-2", "metadata": {}, "source": "## Chebfun: numerical computing with functions" }, { "cell_type": "code", "id": "mp-3", "metadata": {}, "execution_count": null, "outputs": [], "source": "x = chebfun('x', [0 4]);\nf = sin(x.^2);\nr = roots(f);\nfprintf('sin(x^2) has %d roots in [0, 4]\\n', numel(r));" }, { "cell_type": "markdown", "id": "mp-4", "metadata": {}, "source": "## Plot the chebfun and its roots" }, { "cell_type": "code", "id": "mp-5", "metadata": {}, "execution_count": null, "outputs": [], "source": "xx = linspace(0, 4, 400);\nplot(xx, f(xx));\nhold on;\nplot(r, f(r), 'ro');\nhold off;\ntitle('sin(x^2) and its roots');" } ], "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 }