Run code
Open a .m file and select Run in the top bar. The button names the file it will run, for example Run main.m. The runtime panel shows the run's figures and variables, and a console pane in the same panel shows anything the code prints.

Pick what to run
The ⌄ beside the Run button opens the Run menu. From top to bottom it offers:
| Menu item | What runs |
|---|---|
| Run on | Where the next run executes. See Choose where it runs. |
| Run entry point | A named entry point from the project's runmat.toml, listed first when the project has any |
| Run file | The open file and up to three files you ran recently |
| More files… | A searchable list of every runnable file in the project |
| Run all tests, Run selected tests… | The project's tests. See Run tests. |
| Clear variables before run | Starts each run with an empty workspace, as if it began with clear |
| Close figures before run | Closes open figures before each run, as if it began with close all |
A Markdown notebook runs the same way: open it and select Run notebook.md. See Write a runnable notebook.
Choose where it runs
Run on lists This computer in the installed app, or This browser in the browser, followed by your organization's clusters. Each cluster shows its state, for example Active · 3 of 4 nodes free; a cluster that can't take the run is shown greyed out with the reason.
The choice applies to the next run. With a cluster selected, Resources… shows its workers, cores and memory, and how much simulation allowance you have left. Manage clusters… opens Settings › Clusters, where an organization admin adds and drains machines.
An entry point can be limited to one place. Its menu item then reads Runs on a cluster only or Runs on this computer only and is unavailable for the other choice.
Use the Command Window
The Command Window sits under the editor. Select its bar to open it, then type at the >> prompt and press Enter. Up and Down step through earlier commands.

The prompt shares the workspace your scripts use. A script's variables are there after it runs, and a variable you create at the prompt is visible to the next script unless Clear variables before run is on. Use clear to empty the workspace:
>> peak = max(y)
peak = 1.5376
>> overshoot = (peak - 1) * 100
overshoot = 53.7600When a script asks for input with input, the request appears in the runtime panel's console; type the answer there.
Stop a run
While code runs, the Run button becomes Stop. Select it to cancel. The run stops at the next point where the runtime checks for cancellation, so output can continue for a moment before the run header reads cancelled. Figures and variables from a stopped run can be partial; run again before you rely on them.
Read an error
A failed run shows failed in the run header, and the error appears in the runtime panel's console with the file and line where it happened.
- Start with the first error. Later errors often follow from it.
- Open the file the message names and go to its line.
- Fix the code and run again.
The dot to the left of Run is RunMat check. It reports syntax, naming and type problems as you type, so many mistakes show before you run.
To have RunMat Agent look into each failure while you keep working, turn on Look into errors automatically in Settings › General. It uses Agent credits.
For ported MATLAB code, see MATLAB compatibility. For the error format, see Errors and diagnostics.

