adding elements of an array column wise and storing it in different array
11 次查看(过去 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
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!