clear all close all % <--- after '%' is comment line, program skip x0=load('tsd.ix'); % the 1st column: i, 2nd column: x(i) y0=load('tsd.jy'); % the 1st column: j, 2nd column: y(j) cpxy=load('cp.dat'); x=x0(:,2); % :,2 means all rows of 2nd column (is stored as 'x') y=y0(:,2); ix=length(x); jy=length(y); for i=1:ix for j=1:jy xx(i,j)=x(i); % storing x and y data in specification of the Matlab 'contour' function yy(i,j)=y(j); % To see the specification type 'help contour' in Matlab command window end end figure contour(xx,yy,cpxy',200); % cpxy' is a transpose of matrix data cpxy: I output ij loop opposit, but you can do this xlabel('x/c'); ylabel('y/c'); title(' Cp contour (M_{\infty}= 2.0,\alpha=10 deg)'); xlim([-1.0 2.0]); % you can change the axis range here ylim([-1.5 1.5]); % If you comment xlim and ylim, matlab plot with auto range axis square; % this is optional