As I read this question, it is about fitting a model rather than a distribution, so I don't think mle is appropriate. Instead, I suggest:
logR = log(R);
a = fitlm(D,logR,'intercept',false)
The resulting "Estimate" will be a least-squares estimate of q. It may or may not also be maximum likelihood, depending on your assumptions about the model errors.