MATLAB: Hey i could use a small help with the For loop

for loop

for i=1:10
x=input('X wert Point=');
y=input('Y Wert Point=');
K = [x;y];
end
so this is my code and i want to get as answer K1 = [x1;y1] , k2=[x2;y2] ….. etc
it only saves the last 2 numbers i put as K=[a;b],what do i need to change?.
Thank you in advance

Best Answer

Subscript ‘K’:
for i=1:10
x=input('X wert Knote=');
y=input('Y Wert Knote=');
K(:,i) = [x;y];
end
That should do what you want.