I want to make a 2 column matrix for my x and y data which consists of 1000 datapoints, I have tried this and it replaces only one column: x=[0 1 2 3 4 5]; y=[0 1 2 3 4 5]; A = zeros(1000,2); A(:,2)=y; A(:,1)=x;
John Williams answered .
2025-11-20
A = [x(:), y(:)]
That should work.