Code Search for Developers
 
 
  

rtx_makegraph.m from EmStar at Krugle


Show rtx_makegraph.m syntax highlighted

#!/usr/bin/octave -qf

clear all;

function [m, v, conf, cdf, data] = process_file(file)
  retdata=zeros(0);
  eval(sprintf("load -force %s retdata\n", file));

  res_arr=retdata(:, 2)./retdata(:, 3);
  
  data=res_arr;
  m=mean(res_arr);
  v=var(res_arr);
  conf=1.96*(std(res_arr)/sqrt(rows(res_arr))); # 95% confidence interval

  %hist(res_arr,8);
  
  sorted=sort(res_arr);
  cdf=zeros(rows(sorted),2);
  
  for i=1:rows(sorted)
	cdf(i,2)=sorted(i)*10;
	cdf(i,1)=i/rows(sorted);
  endfor
  
  %gplot cdf
  
endfunction


% ----------- Main procedure ----------
if nargin<2
  printf("Usage:\n");
  printf("\t%s outfile xaxisfile infile1 infile2 infile3 ...\n", program_name);
  exit(0);
endif

graph=zeros(nargin-2, 4);
xaxis=zeros(0);
eval(sprintf("load -force %s xaxis\n",  nth(argv,2)));

for i=3:nargin
  printf("Processing file %s...\n", nth(argv,i));
  [m,v,c]=process_file( nth(argv,i) )
  graph(i-2,:)=[xaxis(i-2), m, m-c, m+c];
endfor

eval(sprintf("save %s graph\n", nth(argv,1)));

gplot graph w e t "", graph w l t "Simulation";

printf("Press any key to continue\n");
pause;

%gset output "result/01_cdf.eps"
%gset term postscript eps
%gset grid
%gset title ""
%gplot cdf0 title "Exp 0", cdf1 title "Exp 1", cdf2 title "Exp 2"
%gplot cdf0 title "Exp 0", cdf1 title "Exp 1"

%gset term x11
%replot


















See more files for this project here

EmStar

EmStar is a software system for developing and deploying wireless sensor networks involving Linux-based platforms. As the wireless sensor network community has attempted to deploy more complex designs---large-scale, long-lived systems that need self-organization and adaptivity---a number of difficult software design issues have arisen. Advances in software design have not kept pace with the capabilities of hardware. This is because designing for an adaptive, efficient, and useful sensor network has turned out to be surprisingly complex and difficult. EmStar is a Linux-based software framework, whose goal is to dramatically reduce this complexity, enabling work to be shared and reused, and simplifying and speeding the design of new sensor network applications.

Project homepage: http://cvs.cens.ucla.edu/emstar/
Programming language(s): C,Shell Script
License: other

  graph.m
  makegraphfile.m
  motenictab
  parseh
  parsel
  rnc_test-sc-r
  rnc_test-simconfig
  rnc_test.c
  rnc_test.h
  rnc_test_nornc-simconfig
  rnc_test_sc_pair
  rnc_testtab
  rnc_testtab-r
  rnc_testtab_nornc
  rnc_testtab_passive
  rnctest-flood-rnc-neigh-simconfig
  rnctest-flood-rnc-neigh-tab
  rnctest-multihop-simconfig
  rnctest-multihop-simconfig-nornc
  rnctest-multihop-tab
  rnctest-multihop-tab-nornc
  rnctest-multihop-tab-noxmit
  rnctest-multihop-tab-noxmit-nornc
  rtx_makegraph.m
  simnodes
  xaxis.txt