MATLAB: Why each combination is shown many times

repeatedcombinations

I found all the combinations I need in the command window, but each of them is shown many times.
I tried different unique code but nothing seems to be working, so I temporarily removed them.
Please tell me which part of my script is wrong, and how can I solve this? Thanks.
syms a b;
for a = 1:1:20
for b = 1:1:20
if floor(sqrt(a^2+b^2)) == sqrt(a^2+b^2) && a <= b
k = [a b sqrt(a^2+b^2)];
end
disp(k);
end
end

Best Answer

k = [];
for a = 1:1:20
for b = 1:1:20
if floor(sqrt(a^2+b^2)) == sqrt(a^2+b^2) && a <= b
k(end+1,:) = [a b sqrt(a^2+b^2)];
end
end
end
disp(k)