Run-time or execution-time error:
The Run-time, or execution-time, errors are found whenever a script or function is executing. With most of the languages, an illustration of a run-time error would be trying to divide by zero. Though, in the MATLAB, this will create a warning message. The other illustration would be trying to refer to an element in an array which does not exist.
This script initializes a vector with 3 elements, but then tries to refer to the fourth. Running it prints the three elements in the vector, and then an error message is generated whenever it attempts to refer to the fourth element. Note that it gives a description of the error, and it provides the line number in the script in which the error happened.
??? Tried to access vec(4); index out of the bounds because
Error in ==> runtime_ex at 6