MATLAB playground

Write and run MATLAB in your browser, with nothing to install: the editor, the Command Window and the Workspace, as in the university MATLAB. To try the examples from the Linear Algebra and Geometry articles, practice the assignments or check an exercise on your phone. And, for Mathematics for Computing, calculus too: derivatives, integrals, limits and differential equations with syms, numerical integrals and 3D surfaces you rotate by dragging.

How to use it

  • Files: your .m scripts are the tabs at the top. + creates a new one; the pencil (or a double click on its name) renames it, and the cross deletes it.
  • Run (or F5) is MATLAB’s Run button: it runs the whole script and shows the result in the Command Window, with MATLAB’s own format (x =, the value and its blank lines). Every run starts with an empty Workspace. If there is an error, MATLAB stops there: you get its original message and a card explains what happened and how to fix it.
  • Sections: if your script has lines starting with %%, Ctrl + Enter runs only the section you are in (Run Section). F9 runs the selection or the current line.
  • The >> line at the bottom is the Command Window: type a command and press Enter. It works with what your script left behind (try rank(A) after the example), and ↑ and ↓ bring back the previous ones.
  • Workspace: your variables with their value, size and class, like MATLAB’s pane. Click a matrix to see it in full under Variables.
  • format rat, format long and format change how numbers look, just like MATLAB: format rat fractions are aligned as there.
  • Step by step walks through the script statement by statement: you see what each one does, how the Workspace changes and the output so far; with «Explain it slowly», what each function does (rref, null, eig…).
  • Your code is saved automatically in this browser. Settings holds the rest: light or dark theme, text size, helps, uploading and downloading files, sharing a link with your code and «Restore my previous code».

Keyboard shortcuts

ShortcutWhat it does
F5Runs the open script (Run)
Ctrl + EnterRuns the %% section you are in (or the whole script if there are no sections)
F9Runs the selection or the current line in the Command Window
Ctrl + SpaceShows the suggestions
Ctrl + /Comments or uncomments the selected lines (with %)
↑ and ↓ on the >> lineThe previous commands

On a Mac, Cmd instead of Ctrl.

What you can and cannot do

  • It is not MathWorks MATLAB: it is SergioLearns’ own interpreter, compatible with the part of MATLAB used in Linear Algebra and Geometry and in Mathematics for Computing. I checked it against MATLAB R2025a: the Linear Algebra assignment outputs come out the same, character by character, and the calculus ones give the same results (an integral may come out written in a different but equivalent form).
  • It has real and complex matrices, ranges 1:n, indexing and end, if, for, while, anonymous functions @(x), your own functions with function (at the end of the script or in another .m tab) and the algebra functions: rref, rank, det, inv, A\b, null (also null(A,'r')), orth, lu, qr, eig, norm, dot, cross, trace, poly, roots…
  • Symbolic maths: syms, solve, subs, simplify, diff, int (standard integrals, by parts, substitution and rational functions), limit, taylor, dsolve (separable and linear), gradient, hessian and jacobian, and det, inv, rref or charpoly of symbolic matrices. In your MATLAB, this needs the Symbolic Math Toolbox.
  • Numerical calculus: integral, integral2, trapz, fzero, fminsearch and ode45, with the same tolerances as MATLAB.
  • Plots: plot, fplot, fimplicit, quiver and contour in 2D, and fsurf, surf, mesh, plot3 and fcontour in 3D; 3D figures rotate when you drag them. input() does not ask: data goes in the script.
  • Everything runs in your browser, with no downloads: it starts instantly (the calculus part loads the first time you use it). Each run can last a few seconds at most; a loop that never ends stops by itself.

Practice with it

  • The Linear Algebra and Geometry and Mathematics for Computing topics are arriving in University, each with its MATLAB code to paste here and try; in Mathematics for Computing, each topic also brings its MATLAB practical.
  • If you want to see the graph and the working by hand before writing the code, Roque, the site’s graphing tool, draws the exercise and «Export to MATLAB» opens it here as a script.
  • If you also code in other languages, there is the Python, the Java, the C and the R playground, and all of them together in Playgrounds.