Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

size

MATLAB size function


Description

Provides dimensions of X.

Usage

size(X, dimen)

Arguments

X

vector, matrix, or array object

dimen

numeric scalar specifies particular dimension

Details

This is an S4 generic function. Vector will be treated as a single row matrix. Stored value is equivalent to dim.

Value

Returns object of class size_t containing the dimensions of input argument X if invoked with a single argument. Returns integer value of specified dimension if invoked with two arguments. If dimen specifies a higher dimension than exists, returns 1 representing the singleton dimension.

Note

Handling of vectors is different than in initial implementation. Initial implementation returned length.

Author(s)

Examples

size(2:9)			# 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

matlab

MATLAB emulation package

v1.0.2
Artistic-2.0
Authors
P. Roebuck
Initial release
2014-06-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.