1{
2 "cells": [
3 {
4 "cell_type": "markdown",
5 "id": "mp-0",
6 "metadata": {},
7 "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."
8 },
9 {
10 "cell_type": "code",
11 "id": "mp-1",
12 "metadata": {},
13 "execution_count": null,
14 "outputs": [],
15 "source": "mip load --install chebfun"
16 },
17 {
18 "cell_type": "markdown",
19 "id": "mp-2",
20 "metadata": {},
21 "source": "## Chebfun: numerical computing with functions"
22 },
23 {
24 "cell_type": "code",
25 "id": "mp-3",
26 "metadata": {},
27 "execution_count": null,
28 "outputs": [],
29 "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));"
30 },
31 {
32 "cell_type": "markdown",
33 "id": "mp-4",
34 "metadata": {},
35 "source": "## Plot the chebfun and its roots"
36 },
37 {
38 "cell_type": "code",
39 "id": "mp-5",
40 "metadata": {},
41 "execution_count": null,
42 "outputs": [],
43 "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');"
44 }
45 ],
46 "metadata": {
47 "kernelspec": {
48 "display_name": "numbl (MATLAB syntax)",
49 "language": "numbl",
50 "name": "numbl"
51 },
52 "language_info": {
53 "codemirror_mode": "octave",
54 "file_extension": ".m",
55 "mimetype": "text/x-octave",
56 "name": "numbl",
57 "nbconvert_exporter": "script",
58 "pygments_lexer": "matlab"
59 }
60 },
61 "nbformat": 4,
62 "nbformat_minor": 5
63}