plot_cell.m

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

M
43
字号
function plot_cell% PLOT_CELL	Draw the current location for a cell.%     Copyright (c) 1997-2000 Jiming Liu and Jianbing Wuglobal CELL Current_Goal; Current_X=0;Current_Y=0;Visible_Width=10;cla;plot(Current_X,Current_Y,'color',[1 1 1]);End_X=Current_X+Visible_Width; End_Y=Current_Y+Visible_Width;axis([Current_X,End_X,Current_Y,End_Y]);axis on;Cell_Size=size(CELL);hold on;plot(Current_Goal(1),Current_Goal(2),'LineStyle','+','Color',[0 1 0],...                 'markersize',100/Visible_Width);%                 'erasemode','xor','markersize',100/Visible_Width);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    Cell_Color=get_cell_color(Class_Id);    plot(LocationX,LocationY,'LineStyle','.','Color',Cell_Color,...                 'markersize',200/Visible_Width);%                 'erasemode','xor','markersize',200/Visible_Width);     end  drawnow;end

⌨️ 快捷键说明

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