Dear readers,
Is there any solution to speed up this M-file if n = 1.000.000 ? Any help is much appreciate.
best regards,
Duy Nguyen
tic% number of iteration
n = 1000;% prepare parameters
a = 0; b = 100;alpha = a+(b-a)*rand(n,1);c = 0; d = 2000;beta = c+(d-c)*rand(n,1);% loop
t = 1:500;TTD = zeros(numel(t),n);for i = 1:n TTD(:,i) = gampdf(t,alpha(i),beta(i)); endtoc% Elapsed time is 1.082072 seconds.
Best Answer