MATLAB: Specify max limit to data from data file

data limit

end
D = load('data.txt');
x = D(:,1);
y = D(:,2);
I would like to specify data to be passed to a function to be limited to N indices.
Anyone have any suggestions?
Cheers!

Best Answer

x = D(1:N,1);
y = D(1:N,2);