This thread went all kinds of crazy. I don't have MATLAB, but because power is measured in Watts (or milliWatts as the case may be), if you want the dBm value that tells you the attenuation or gain of the signal, you have to use 10 log(Output/Input). If you are calculating using voltage or current, the formula is 20 log (Output/Input) because power is proportional to the square of the signal's amplitude (voltage). The logarithmic squares law applies.
Have you answered the question in post#1 which asks what is the conversion from X db's/decade to Y db's/octave?
Ratch