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.

Frame creationThis is made <strong>in</strong> order to avoid pixel values along the edges.The algorithm must not calculate cells exceed<strong>in</strong>g x-m<strong>in</strong>/max or y-m<strong>in</strong>/max.<strong>for</strong> a=1:1;%loop only the first row<strong>for</strong> b=1:col;%loop every columndata(1,b)=0;%set the cell values to zero, to create a border above the dataendend<strong>for</strong> c=1:row;%loop every rowdata( c,1)=0;data( c,col)=0;%set the cell values of the first and last column to zero, to create%borders to the left and right of the data.end<strong>for</strong> d= row:row;%loop only last row.<strong>for</strong> e=1:col;%loop every column.data(row,e)=0;%set the cell values to zero, to f<strong>in</strong>alize the frame.endendCreation and def<strong>in</strong>ition of variables and matricescells = sum(data(:)>0);%counts the number of cells <strong>in</strong> "data" greater than zero.output=zeros(row,col);%creates a matrix to write the output <strong>in</strong>to.rivercells=zeros(cells,3);%creates a matrix of 3 x "cells" and fills it with zeros.%It will soon conta<strong>in</strong> all values and coord<strong>in</strong>ates from "data".order=zeros(cells,3);% creates a matrix of 3 x "cells" and fills it with zeros.%It will soon conta<strong>in</strong> ranked coord<strong>in</strong>ates from "rivercells".%Highest elevation is ranked as number 1 <strong>in</strong> "order".rivercells_row=0;75

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

Saved successfully!

Ooh no, something went wrong!