MATLAB: Finding n (the number of dots in base of triangle) using while loop with known triangle nummber (T=120)

while loop

How am I supposed to write the skript using a while loop to find the number of n when i know that the sum of the triangle is 120?
n = 0;
T = ?
t = 0 %
while t ?
n = ?
t = ?
end

Best Answer

t = 1;
n = 1;
while t<120
n=n+1;
t = t+n;
end
disp(n)