1{
2 "cells": [
3 {
4 "cell_type": "markdown",
5 "id": "pkg-title",
6 "metadata": {},
7 "source": "# Installing packages (still no server)\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)."
8 },
9 {
10 "cell_type": "code",
11 "execution_count": null,
12 "id": "pkg-install",
13 "metadata": {},
14 "outputs": [],
15 "source": [
16 "mip load --install chebfun"
17 ]
18 },
19 {
20 "cell_type": "code",
21 "execution_count": null,
22 "id": "pkg-roots",
23 "metadata": {},
24 "outputs": [],
25 "source": [
26 "% Chebfun: numerical computing with functions\n",
27 "x = chebfun('x', [0 4]);\n",
28 "f = sin(x.^2);\n",
29 "r = roots(f);\n",
30 "fprintf('sin(x^2) has %d roots in [0, 4]\\n', numel(r));"
31 ]
32 },
33 {
34 "cell_type": "code",
35 "execution_count": null,
36 "id": "pkg-plot",
37 "metadata": {},
38 "outputs": [],
39 "source": "% Evaluate the chebfun on a grid and mark its roots\nxx = linspace(0, 4, 400);\nplot(xx, f(xx));\nhold on;\nplot(r, f(r), 'ro');\nhold off;\ntitle('sin(x^2) and its roots');"
40 }
41 ],
42 "metadata": {
43 "kernelspec": {
44 "display_name": "numbl (MATLAB syntax)",
45 "language": "numbl",
46 "name": "numbl"
47 },
48 "language_info": {
49 "codemirror_mode": "octave",
50 "file_extension": ".m",
51 "mimetype": "text/x-octave",
52 "name": "numbl",
53 "pygments_lexer": "matlab"
54 }
55 },
56 "nbformat": 4,
57 "nbformat_minor": 5
58}