Run code and use the Command Window
Open a .m file and select Run to execute it. Printed output and errors appear in Output, while variables and figures appear in their corresponding views.
Choose what to run
- Current file runs the script open in the editor.
- Selection runs the selected expression using the current workspace.
- Project entrypoint runs an entrypoint declared in
runmat.toml. - Notebook actions run one cell, a sequence of cells, or the complete notebook.
- Tests run focused tests or the project suite from the Tests view.
Use the current file or a selection while exploring. Use the project entrypoint or full test suite when checking the complete workflow.
Choose an execution target
The target menu lists the execution locations available to the project. Jobs run locally by default. A remote target is useful for workloads that need more memory, additional GPUs, greater concurrency, or hardware unavailable on the computer.
The selected target applies to the next run. Confirm it before starting a long job.
Use the Command Window
Enter an expression at the >> prompt and press Enter. Up and Down move through command history. The Command Window retains variables between commands and can inspect values created by a script.
>> A = rand(1000);
>> size(A)
>> b = A * ones(1000, 1);
>> [min(b), mean(b), max(b)]Use clear to remove workspace variables or restart the project session for a fresh Runtime. Output from interactive commands has its own transcript.
Stop a run
Select Stop to request cancellation. RunMat checks for cancellation during execution and then marks the run as cancelled. A partially completed run may have produced output, variables, or figures; start a fresh run before using those results as a final answer.
When a program requests input, respond in the Command Window. Stopping the run also closes its pending input request.
Read an error
- Select the failed run.
- Start with the first error and its source location.
- Open the linked source line when one is available.
- Correct the source or configuration and run again.
Compilation and compatibility diagnostics appear before execution. Runtime errors can include the call stack and the values or operation involved. Remote failures also identify the target that handled the job.
For ported MATLAB code, see MATLAB compatibility. For deeper Runtime diagnostics, see Errors and diagnostics.