TXT文件名的格式为E_Field10.txt 、E_Field20.txt ......E_Field4000.txt .
记录的一个平面的场分布
% input the base file name
f = 'E_Field';
% input the total number of iterations
n = 4000;
% input the value of time step
k = 10;
%Input x axis label
xAxisLabel = 'Y';
%Input y axis label
yAxisLabel = 'X';
%Input Plot title
graphTitle = 'E Field';
% index variable for Movie
i = 1;
% movie initialization
M = moviein(n / k);
% loop n / k times
for m = k : k : n
% full file name
file = [f '_' int2str(m) '.txt'];
% load the file to A
A = load(file);
% pseudocolor plot
pcolor(A);
% a color bar
colorbar;
% set equal size tick marks
axis image;
% Min & max value for color code
caxis([-1e-1 1e-1]);
% shading in interpolated format
shading interp;
% set label for x axis
xlabel(xAxisLabel);
% set label for y axis
ylabel(yAxisLabel);
% title of the plot
title([graphTitle, ' At Time Step = ', int2str(m)]);
% store the frame for movie
M(:, i) = getframe;
% increment movie frame index
i = i + 1;
% end of loop
end;