MATLAB is a computer program designed to perform various scientific and technical computations. It also has visualization and simulation capabilities. Its command-line interface can be used to enter commands one by one. Each command is executed as soon as "Enter" is pressed after typing in the command. These commands can also be written sequentially in a file with an "m" extension. This sequence of commands is called a MATLAB program. When this file is double clicked, MATLAB starts executing the program. It is possible to stop the execution of the program at any time during the run.
Start MATLAB by double-clicking its icon on the desktop or from "All Programs" in the "Start" menu.
Click on the button with three dots in the top menu bar. This will open a file browser window. Browse to the folder where your program resides and click "OK."
Double-click on the name of the program to be executed in the file explorer panel on the left. This will start the program.
Left-click anywhere in the command-line interface window of MATLAB. This is where MATLAB allows one to enter commands. It's the largest window in the middle. Press "Ctrl-C" when the program is to be stopped. The program will stop executing.
Tips & Warnings
- Sometimes the program will not stop running after pressing "Ctrl-C." In this case, the MATLAB program itself can be stopped by clicking on the cross button at the top-right corner.