If the vector on the left of the equal sign does not exist it is created to fit the expression on the right hand side of the equal sign. This allows you to increase the size of a vector simply by assigning a value to an element that has not been previously used. This augmentation should be avoided for vectors involved in computations where speed is critical. Refer to Pre-allocating memory for vectors and matrices for a discussion of the performance issues. Automatic augmentation of vectors does not allow you to refer to elements that have not yet been allocated.
Index exceeds matrix dimensions.
It is often used in copy operations and in the creation of vectors and matrices. The numbers xbegin , dx , and xend need not be integers. The preceding statements create row vectors. Using colon notation to create a vector requires you to specify the increment, whereas using the linspace command requires you to specify the total number of elements. The following commands show how to create the same vector with both approaches.