- HasNan
- Transpose
- TransposeConjugate
- TriL
- TriU
- Diag
- Row
- Col
- Copy
- Concat
- Compare
- CompareByDigits
- CompareEqual
- Flat
- Clip
- Reshape
- Resize
- Set
- SwapRows
- SwapCols
- Split
- Hsplit
- Vsplit
- ArgSort
- Sort
Resize
Return a new matrix with a changed shape and size.
bool matrix::Resize(
|
Parameters
rows
[in] New number or rows.
cols
[in] New number or columns.
Return Value
Returns true on success, false otherwise.
Note
The matrix (or vector) is processed in place. No copies are created. Any size can be specified, i.e., rows_new*cols_new!=rows_old*cols_old. Unlike Reshape, the matrix is processed row by row. When increasing the number of columns, the values of the extra columns are undefined. When increasing the number of rows, the values of elements in the new rows are undefined. When the number of columns is reduced, each row of the matrix is truncated.
Example
matrix matrix_a={{1,2,3},{4,5,6},{7,8,9},{10,11,12}};
|