How to generate all pairwise differences between two vectors
显示 更早的评论
Hi,
how can I generate a new vector of all the pairwise differences between two existing vectors?
thanks,
Tamir
回答(4 个)
Andrei Bobrov
2019-2-6
out = a(:) - b(:)';
Tamir Eisenstein
2019-2-15
编辑:Tamir Eisenstein
2019-2-15
0 个投票
Andrei Bobrov
2019-2-15
0 个投票
out = (a(:)' - b(:))./b(:)*100;
类别
在 帮助中心 和 File Exchange 中查找有关 Discrete Math 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!