plot_env

PURPOSE ^

plots the result

SYNOPSIS ^

function fig = plot_env(par,bs,mob,plot_path)

DESCRIPTION ^

 plots the result

  INPUT
   par         parameters structure
   mob         mobiles structure
   bs          base-stations structure

  OUTPUT
   fig         figure representing the environment


 $Id: plot_env.m,v 1.4 2004/07/16 03:46:24 dalai Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % plots the result
0002 %
0003 %  INPUT
0004 %   par         parameters structure
0005 %   mob         mobiles structure
0006 %   bs          base-stations structure
0007 %
0008 %  OUTPUT
0009 %   fig         figure representing the environment
0010 %
0011 %
0012 % $Id: plot_env.m,v 1.4 2004/07/16 03:46:24 dalai Exp $
0013 
0014 function fig = plot_env(par,bs,mob,plot_path)
0015 
0016 disp(dispconsole('|','=','|'));
0017 disp(dispconsole('|','Plotting results','','','|'));
0018 disp(dispconsole('|','=','|'));
0019 
0020 hold on
0021 fig = plot([bs.xy],'r*');
0022 disp(dispconsole('|','plotting base-stations',':','ok','|'));
0023 
0024 if (plot_path==1)
0025     plot(reshape([mob.xy],par.tmax+1,par.mob),'-');
0026 end
0027 
0028 plot(reshape([mob.xy],par.tmax+1,par.mob),'.');
0029 disp(dispconsole('|','plotting mobiles',':','ok','|'));
0030 
0031 switch(par.model)
0032     case 1
0033         axis([-par.r par.r 0 2]);
0034 
0035     case 2
0036         mk_sqr_net(11,11,180,20,'k');
0037         axis([-1200 1200 -1200 1200]);
0038 
0039     case 3
0040         plot(par.vertices,'k-+');
0041         mk_hex_net(par,'b');
0042 end
0043 disp(dispconsole('|',sprintf('plotting %s environment',char(par.models(par.model))),':','ok','|'));
0044 hold off;

Generated on Sun 15-Aug-2004 22:13:10 by m2html © 2003