How to add values in the array in matlab?

3 次查看(过去 30 天)
I have an array with eleven elements in a single column. I want to add all these elements.
I have,
D=regionprops(L2,'area')
In array D, I have all values of area. I want to add all the values in D.
Please guide me. Thanks in advance.

回答(1 个)

KSSV
KSSV 2019-11-13
Read about sum
D = rand(11,1) ;
thesum = sum(D)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by