d1 = [0 0 2
0 0 -2 ];
d2 = [0 0 15
0 0 13 ];
k = 1;
for i = 1:2
for j = 1:2
d12(k,:) = [d1(i,:)-d2(j,:)];
k = k+1;
end
end
you can initiate k as 1 then increase it by one
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!