You have the name of the file stored in filename combined with the path to the directory where the file is stored in pathname but you actually haven't read any of the contents. To do that, the easiest thing would be to use dlmread. I'm assuming your text file is properly formatted to have two rows of data as you stated. If this is the case, you need to change the way you're indexing into your data. You have it indexing entire columns instead of rows so you need to flip the indexing in your code. Also, you need a call to dlmread, then access the columns of the resulting matrix:
%% Get the data
[filename, pathname] = uigetfile('*txt', 'Pick text file');
data = dlmread(fullfile(pathname, filename));
x=data(1,:);
y=data(2,:);
plot(x,y);
Notice that I made the full path to your file to use fullfile because using uigetfile allows you to read in a file from anywhere on your computer so we make sure that we capture the full path to your file. Again to reiterate, pathname is the directory of where the file is contained and filename is the name of the file contained in the directory.