plot_cell_no.m

来自「多智能体工具包」· M 代码 · 共 53 行

M
53
字号
function plot_cell_no(CELL)% PLOT_CELL_NO	Plot the current location for a cell.%     Copyright (c) 1997-2000 Jiming Liu and Jianbing WuCurrent_X=0;Current_Y=0;Visible_Width=10;End_X=Current_X+Visible_Width; End_Y=Current_Y+Visible_Width;Cell_Size=size(CELL);clg;%plot(Current_X,Current_Y,'color',[1 1 1]);plot(0,8,'color',[1 1 1]);%axis([Current_X,End_X,Current_Y,End_Y]); axis([0,2,8,10]);axis on;hold on;for mm=1:Cell_Size(1)  Class_Id=CELL(mm,1);  LocationX=CELL(mm,3);  LocationY=CELL(mm,4);  if LocationX<=End_X & LocationX>=Current_X ...         & LocationY<=End_Y & LocationY>=Current_Y    if Class_Id==0      Cell_Color='g';      Line_Style='+';      Marker_Size=400/Visible_Width;    elseif Class_Id==1      Cell_Color='r';      Line_Style='*';                     Marker_Size=250/Visible_Width;    elseif Class_Id==2      Cell_Color='b';      Line_Style='*';                     Marker_Size=250/Visible_Width;    elseif Class_Id==3      Cell_Color='w';      Line_Style='.';                     Marker_Size=800/Visible_Width;    end    plot(LocationX,LocationY,'LineStyle',Line_Style,'Color',Cell_Color,...         'erasemode','xor','markersize',Marker_Size);  end  drawnow;end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?