Determination of effective permittivity and permeability of metamaterials from reflection and transmission coefficients