I have a nx1 vector and a 1xn vector. I want to add them in a special manner like matrix multiplication in an efficient manner (vectorized):
Example:
From R2016b you can simply do:
A=[1 2 3]' B=[4 5 6] A+B ans = 5 6 7 6 7 8 7 8 9
Matlab will silently expand both vectors and do the element wise sum. This feature has not been without it's controversy. You can check the details here:
Matlab expands arithmetic