murbad=readxls("thane_murbad_census_I.xls")
mu=murbad(1); // this picks out the first sheet
[numrows,numcols] = size(mu) // should output 211. 64.
mu.value; // will list out the numeric part of the sheet
// and put a NaN (not a number) where it sees text
mu.text; // does it for the non-numeric data
I=[]; for i=1:numrows if mu(i,7)=="VILLAGE" I=[I i]; end; end;
murbadnumeric=mu(I,[10:64]);
size(murbadnumeric) // should give you 205. 55.
save murbadnumeric // now a load will get this back for us
values=murbadnumeric(:,15); //the total literate male population in each village
values_1=murbadnumeric(:,16); //the total literate female population in each village
text=mu(I,8);
[a,numvillages] = size(I); 
frequency=murbadnumeric(:,3); // the total male population in each village 
frequency_1=murbadnumeric(:,4); // the total female population in each village 
//values=linspace(1,100,numvillages);//synthetic ages
//values_1=45.+rand(1,numvillages)'*10;//synthetic weights
values=values./frequency; //the fraction of male population that is literate in each village
values_1=values_1./frequency_1; //the fraction of female population that is literate in each village
//[frequency,k]=gsort(frequency); //sort the population in decreasing order and return the indices corresponding to the sort order in "k"
[frequency,k]=gsort(frequency,'g','i'); //sort the population in increasing order and return the indices corresponding to the sort order in "k"
values=values(k); //reorder the frequency vector using k
values_1=values_1(k); //reorder the frequency_1 vector using k
text=text(k); //reorder the text vector using k
