-
Notifications
You must be signed in to change notification settings - Fork 9
size
Outputs the dimensions (size) of the given object.
Returns a row vector containing the number of rows (1, 1) and the number of columns (1, 2).
Argument M
Matrix
Returns 1. entry
Matrix
size([1,2,3,4,5])
Results in a vector with the elements 1 and 5, since we have 5 columns and 1 row.
size(rand(2))
Results in a vector with the elements 2 and 2, since we have 2 columns and 2 rows.
Returns a row vector containing the number of rows (1, 1) and the number of columns (1, 2), which is 1 and 1 for any scalar.
Argument x
Scalar
Returns 1. entry
Matrix
Returns a row vector containing the number of rows (1, 1) and the number of columns (1, 2), which is 1 and the number of characters for any string.
Argument str
String
Returns 1. entry
Matrix
size("hello")
Results in a vector with the elements 1 and 5, since we have 5 charaters.