% generate gamma distributed random numbers:
n = 50;
shape = 2.0;
scale = 1.0;
x = gamrnd(shape, scale, n, 1);

% maximum likelihood estimate:
p = mle(x, 'distribution', 'gamma');

% report results:
fprintf('shape=%.2f\n', p(1));
fprintf('scale=%.2f\n', p(2));
