a = [1, 2];
b = [11, 12];
MA = zeros(4, 3);
k = 0;
for i = 1 : length(a)
for j = 1 : length(b)
%v = 2*a(i) + b(j)
v = 2*a(i) + b(j);
k = k + 1;
MA(k, :) = [a(i), b(j), v];
end
end
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!