How to generate all pairwise differences between two vectors
Show older comments
Hi,
how can I generate a new vector of all the pairwise differences between two existing vectors?
thanks,
Tamir
Answers (4)
Andrei Bobrov
on 6 Feb 2019
out = a(:) - b(:)';
Tamir Eisenstein
on 7 Feb 2019
0 votes
Tamir Eisenstein
on 15 Feb 2019
Edited: Tamir Eisenstein
on 15 Feb 2019
0 votes
Andrei Bobrov
on 15 Feb 2019
0 votes
out = (a(:)' - b(:))./b(:)*100;
Categories
Find more on Discrete Math in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!