MATLAB: Line vector + row vector = array works in r2017a but not in r2016a

+additionarraylineMATLABMATLAB and Simulink Student Suiter2016ar2017arow

I use the + operator in my r2017a version to sum a line vector and a row vector to give me an array.
A = [1 2]
B = [1;2]
C = A + B = [2 3; 3 4]
I tried to run my code on an other computer with the r2016a version but it doesn't work.
How can I simply do this command?

Best Answer

For older versions use bsxfun instead
C = bsxfun(@plus,A,B)