how i count the values.
古いコメントを表示
suppose, a=[1,2,3,4,5,6,7,8], the size of this matrix 1 rows and 8 columns and total values are 8, how can we count these total values on MATLAB. the result should be show like as 8 means if a has total values 1000 then the result should be 1000.
採用された回答
その他の回答 (1 件)
Jason Ross
2013 年 3 月 20 日
編集済み: Jason Ross
2013 年 3 月 20 日
Are you just looking for the sum? In that case, use "sum"
>> a=[1,2,3,4,5,6,7,8]
a =
1 2 3 4 5 6 7 8
>> sum(a)
ans =
36
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!