%实现功能,对下表所示获取的数据进行处理绘图,如A0-A3是三次采样结果,随时间变化是A0-C0
%A0 A1 A2 A3
%B0 B1 B2 B3
%C0 C1 C2 C3
%单引号内为文件路径名
d=importdata('D:\ninewallgg.dat'); %读取后为矩阵
%对矩阵进行转置
%d=d';
%例如求A0,A1,A2平均值
average=mean(d);
x=0.05:0.1:0.95;
%plot(x,y,'--hr','LineWidth',1.5,'MarkerEdgeColor','c','MarkerFaceColor','m
%','MarkerSize',10);
%设置背景颜色
figure('color','white');
%设置线宽为2,线型,颜色,标记大小等
plot(x,average,':*k','linewidth',2,'MarkerSize',5);
%保留图形,继续画其他的
hold on;
plot(x,av,':*b','linewidth',2,'MarkerSize',5);
hold on;
%抽取第一列和第二列分别绘图
%plot(dd(:,1),dd(:,2));
%设置坐标轴属性
axis normal;
%axis([0 0.4 0 150]);
%set(gca,'XGrid','on');
set(gca,'YGrid','on');
%设置标注框内容及格式
dds=legend('Von Neunann邻域','Moore邻域');
set(dds,'FontSize',12);
%设置标题
title('不同邻域对比','FontSize',14);
%设置坐标轴名称,字体大小
xlabel('init density','FontSize',14);
ylabel('The total time of evacation','FontSize',12);。