MATLAB: Matrix iteration and subtraction

matrix manipulation

y=
6
7
2
4
S=
8
1
3
0
d=|y-s| for each iteration y take one value and subtract with each value of s eg: first iteration d=
2
5
3
6
how to find d value for four iterations

Best Answer

d = abs(bsxfun(@minus,y(:),s(:)'));
Related Question