MATLAB: Simple 2D contour plots

contour

navg = 11;
filenames = cell(navg,1);
for i = 1:navg
filenames = sprintf('queen2_test_%d.dat', i);
mydata{i} = importdata(filenames);
% writematrix(avg_mat{i}, filenames{i});
R = mydata{i}(:,1);%X
C = mydata{i}(:,2);%Y
F = mydata{i}(:,7);%F(X,Y)
figure
contour(R,C,repmat(F,1,numel(C))');%error line
contourf(R, C, F)% error line
end
Please help me to plot and save high quality contour plots for a sequence of files. I am attaching the code and the data files for your reference.

Best Answer

Create the meshgrid of R,C,F then plot contour