10.07.2015 Views

Finding Potential Sites for Small-Scale Hydro Power in Uganda: a ...

Finding Potential Sites for Small-Scale Hydro Power in Uganda: a ...

Finding Potential Sites for Small-Scale Hydro Power in Uganda: a ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ivercells_col=0;%the variables "rivercells_row" & "rivercells_col" are set to zero.row_number= 0;%the variable "row_number" is set to zero.highest_value=0;%the variable "highest_value" is set to zero.next=zeros(1,2);%creates a array "next" and fills it with zeros.prev(1,1)=10000;prev(1,2)=10000;%the array "prev" is filled with 10000.x=0;y=0;%the variables "x" & "y" are set to zero.Extraction and rank<strong>in</strong>g of height values of <strong>in</strong>put dataf=1;%sets the counter "f", used <strong>in</strong> loop below, to one.<strong>for</strong> g=1:(row);%loop from 1 to number of rows.<strong>for</strong> h=1:(col) ;%loop from 1 to number of columns.if data(g,h) >0;%if value of cell is greater than zero ->rivercells(f,1)=g;rivercells(f,2)=h;%sets row "f" & column 1 & 2 <strong>in</strong> "rivercells"%to current row and column.rivercells(f,3)=data(g,h);%sets row "f" & column 3 <strong>in</strong> "rivercells" to current cellvalue.f=f+1;%adds 1 to the counter "f".endendendorder= sortrows(rivercells,3);% sorts the matrix "rivercells" <strong>in</strong> ascend<strong>in</strong>g order <strong>in</strong>toexecution_time1=etime(clock,time1)%stops clock 1.the matrix "order".76

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!