pracma (version 1.9.9)

size: Size of Matrix

Description

Provides the dimensions of x.

Usage

size(x, k)

Arguments

x
vector, matrix, or array
k
integer specifying a particular dimension

Value

vector containing the dimensions of x, or the k-th dimension if k is not missing.

Details

Returns the number of dimensions as length(x).

Vector will be treated as a single row matrix.

See Also

dim

Examples

Run this code
size(1:8)
size(matrix(1:8, 2, 4))		# 2 4
size(matrix(1:8, 2, 4), 2)	# 4
size(matrix(1:8, 2, 4), 3)	# 1

Run the code above in your browser using DataCamp Workspace