
clear all;
close all;
clc

% Data file with two columns containing the curvilinear coordinates
% for the astroid.
load finalgriddata.dat
n1=81;
n2=41;

%---------------This will break up the data into appropriate matrices
% --------------You don't need to process your grid through this loop.
% --------------I needed to do this because finalgriddata.dat is a data
%---------------file created and imported from a FORTRAN code.
for j=1:n2
    for i=1:n1
        x(i,j)=finalgriddata((j-1)*n1+i,1);
        y(i,j)=finalgriddata((j-1)*n1+i,2);
    end
end

u=zeros(n1,n2);
figure;
orient landscape;
mesh(x,y,u,'EdgeColor','black');
grid on;
xlabel('x')
ylabel('y')
axis square;
view(0,90);