This MATLAB code calculates relative permeabilities of two fluids flowing between two parallel plates, depending on their viscosities, saturation and boundary conditions at the top and bottom plates. The underlying assumptions behind the derivation are shown in the pdf "overview_relativepermeabilities.pdf", where also the resulting equations are listed. The matlab file "relativePermeabilities.m" performs the actual calculation of the relative permeabilities, for given saturation, viscosities of both fluids and slip lengths at the boundaries. The matlab file "example_usage.m" shows an example of how to use "relativePermeabilities.m".