Pairwise summation of two vectors?

4 次查看(过去 30 天)
Is there a way how to do easily pairwise summation between two vectors? Something like pdist but with sum instead of distance. I want to have sum of every number of one vector with every number of second vector. Thanks

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2014-11-30
编辑:Azzi Abdelmalek 2014-11-30
a=[1 2 3]
b=[4 5 6 7]
c=bsxfun(@plus,a.',b)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by