adding elements of an array column wise and storing it in different array
4 ビュー (過去 30 日間)
古いコメントを表示
delay consists of some rows and columns.How to add its elements column wise and store it in another array with rows as earlier and column is 1
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152524/image.png)
0 件のコメント
回答 (1 件)
Shivam Chaturvedi
2015 年 12 月 8 日
編集済み: Shivam Chaturvedi
2015 年 12 月 8 日
You can use the sum function ( Sum of Array Elements [link to doc page] ) and since you need to sum on the columns, you can specify the dim parameter (should be 2 in this case to sum up column wise).
columnwise = sum(arr,2) % will get the columns summed up. Result will be 1 column.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!