4.1 Introduction to MATLAB Data Types
4.1.1 Matrices
By default, all variables in MATLAB are double-precision matrices. You do not need to declare a type for these variables. Matrices can be multidimensional and are accessed using 1-based indices via parentheses. You can address elements of a matrix using a single index, taken column-wise, or one index per dimension. To create a matrix variable, simply assign a value to it, like this 2 × 2 matrix a:
>> a = [1 2; 3 4];
>> a(1,1)
1
>> a(3)
2
You can ...