sum() function gives error

Code for simple creation of array and calculating the sum using the sum() function.
I copied the code from the documentation and it just won't work for me.
Can anyone help me out!!
(I only have the trial version and I have tried the code in the online trial version as well as on the trial software)

回答(2 个)

Bruno Luong
Bruno Luong 2020-7-18
编辑:Bruno Luong 2020-7-18

1 个投票

You have created a variable named SUM in your workspace that shadows MATLAB stock function SUM.

类别

在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息

产品

版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by