The basic elements that MATLAB uses are matrices. Once the matrices have been entered or generated, the user can quickly perform sophisticated computations with a minimal amount of programming.
Entering matrices in MATLAB is easy. To enter the matrix
type
or the matrix could be entered one row at a time:
Once a matrix has been entered, you can edit it in two ways. From the command window, you can redefine any entry with a MATLAB command. For example, the command will change the third entry in the first row of A to 5. You can also edit the entries of a matrix from the Workspace Browser. To change the entry of A with the Workspace Browser, we first locate A in the Name column of the browser and then click on the array icon to the left of A to open an array display of the matrix. To change the entry to a 5, click on the corresponding cell of the array and enter 5.
Row vectors of equally spaced points can be generated using MATLAB’s: operation. The command generates a row vector with integer entries going from 2 to 6.
It is not necessary to use integers or to have a step size of 1. For example, the command will produce
3.144.16.254