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

sum

MATLAB sum function


Description

Provides sum of elements.

Usage

sum(x, na.rm=FALSE)

Arguments

x

numeric or logical to be summed

na.rm

logical scalar. If TRUE, remove missing values

Details

This is an S4 generic function.

Value

Return value depends on argument x. If vector, returns the same as sum. If matrix, returns vector containing the sum of each column.

Author(s)

Examples

sum(1:9)
sum(matrix(1:9, 3, 3))

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.