% You may wanna change the values below according to your % particular problem file_name = 'data_2d.out'; x_min = 0; x_max = 1; y_min = 0; y_max = 1; % read the file data = textread(file_name); % find the size n = sqrt(size(data,1)); % reshape the data data = reshape(data,n,n)'; % construct the vectors of x,y coordinates x = x_min : (x_max-x_min)/(n-1) : x_max; y = y_min : (y_max-y_min)/(n-1) : y_max; % plot the data surf(x,y,data);