---
description: >-
  This section will familiarise yourself with the Graphical User Interface and
  basic actions such as executing a command.
---

# Graphical User Interface

## Executing commands

In MATLAB you can execute commands either by directly entering them into the command window or by executing them from the script editor.

The most common way to execute commands is while working on a script/program (called _.m file_). After opening a (new) script in MATLAB, enter the commands into the script editor, then execute single commands by right-clicking on them and choosing "Evaluate" or run your whole script by clicking "Run". A good tip is to always start your script with the following three commands that will clear your workspace, close any open plots and clear the console.

```
clear all; close all; clc;
```

![Executing a command from the script editor](https://1418968082-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lp2LO4uQaxs9KN1kWAs%2F-LpPqBDRQrXiq9BSePDs%2F-LpPraM6rG7qTu14KpvZ%2Fexecuting-commands.png?alt=media\&token=98eba54a-80fc-4b8d-be98-e2dc16f1b0a2)

Alternatively, you can execute commands by directly typing them into the command window and hitting the return key (Enter) on your keyboard to evaluate them. This is very useful e.g. for trying out commands, opening help/documentation on a command or performing one-time actions such as manually exporting data.

![Executing a command from the Command Window](https://1418968082-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lp2LO4uQaxs9KN1kWAs%2F-LpPqBDRQrXiq9BSePDs%2F-LpPreAuK8GcBhSbFKHG%2Fcommand-window.png?alt=media\&token=9134fe4b-ac68-4499-99c1-93be5162527e)

