Trying to READ an element of an array that is out of bounds will generate an error, but WRITING to one will simply expand the array to accommodate the new data ( so long as the indices are positive. ) For example:
data = ones( 2, 2 ); % Creates a 2 x 2 array of value 1
whos
x = data( 3, 3 ); % Error - element doesn't exist.
whos
data( 3, 3 ) = 42 % Sets the value and expands the array, filling with zeros.
whos