什么是SUM函数以及如何在Python,Excel和Mathlab中使用?

SUM is the short form of the summation which is a mathematical operation. SUM is a very popular term used in computing, programming, scripting to describe the mathematical summation operation.

SUM是求和的简称,它是一种数学运算。 SUM是一个非常流行的术语,用于计算,编程,脚本来描述数学求和运算。

SUM的用法 (Usage Of SUM)

Sum is a mathematical function which can summation of two or more numbers. This means at least two number or parameters to require for the summation. More than two numbers also used and expressed like below as mathematical way.

Sum是一个数学函数,可以将两个或多个数字相加。 这意味着求和至少需要两个数字或参数。 还使用了两个以上的数字,并以数学方式表示如下。

2 + 3 = 5

2 + 3 + 4 = 9

2 + 3 + 4 + 5 = 14

Python Sum函数示例(Python Sum Function Examples)

Python programming language provides the sum() function for the summation operations. Sum function can accept a list type of numbers for the summation. The summation result will be returned by the sum function. The parameters should be integer or floating-point. The list type can be a list or tuple. Also a staring number can be added after the list type for the summation. This starting number is optional parameter.

Python编程语言为求和操作提供sum()函数。 Sum函数可以接受数字的列表类型进行求和。 求和结果将由求和函数返回。 参数应为整数或浮点数。 列表类型可以是列表或元组。 同样,可以在列表类型之后添加凝视数字以求和。 该起始编号是可选参数。

sum(LIST,START_NUMBER)
result = sum((1,2,3))
print(result)
# The output will be 6


result = sum([1,2,3,4,5])
print(result)
# The output will be15


result = sum([1,2,3,4,5],10)
print(result)
# The output will be25
Python Sum Function Examples
Python Sum函数示例

Excel Sum函数示例(Excel Sum Function Examples)

Ms Office Suite member Excel also provides the SUM function where given cell values can be summed. The cell values should be numerical values and if the values are string type the SUM function will throw error. The cell name or range is provided to the SUM function where multiple cell ranges can be also provided

Office Suite成员Excel女士还提供了SUM函数,可以在其中求和给定的单元格值。 单元格值应为数字值,如果值是字符串类型,则SUM函数将引发错误。 单元格名称或范围提供给SUM函数,其中还可以提供多个单元格范围

SUM(CELL_RANGE1,CELL_RANGE2,…)

SUM(CELL_RANGE1,CELL_RANGE2,...)

Excel Sum Function Examples
Excel Sum函数示例

Matlab Sum函数示例(Matlab Sum Function Example)

Matlab is another application that provides the sum() function for different ways for summation. Matlab sum function can be used for different parameter types like Vector, Matrix Columns, Rows, Array Slices, 3-d Aray, Integers, etc. Below we will make some sum() function examples with different data types.

Matlab是另一个为不同的求和方式提供sum()函数的应用程序。 Matlab sum函数可用于不同的参数类型,例如Vector,Matrix Columns,Rows,Array Slice,3-d Aray,Integers等。下面我们将给出一些具有不同数据类型的sum()函数示例。

LEARN MORE  Linux Bash Operators Like Assignment, Plus, Calculation
了解更多Linux Bash运算符,例如赋值,加号,计算
Sum of Vector Elements
向量元素的总和
Sum of Matrix Columns
矩阵列总和
Sum of Matrix Rows
矩阵行总和
Sum of 32-bit Integers
32位整数的总和

翻译自: https://www.poftut.com/what-is-sum-function-and-how-to-use-in-python-excel-and-mathlab/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值