function gmm_accuracy_and_time

load ftrslabs;


ndim = [2:13]'; % 2 to 13 dimensions
time = zeros(length(ndim),1); % store the time
acc = zeros(length(ndim),1); %store the accuracy

for i=1:length(ndim)    
    [M0, M1, acc(i), time(i)] = traingmms(ftrs(:,1:ndim(i)), labs, 5);
end

figure
subplot(211);
plot(ndim,time);
title('Dimensions versus execution time');
ylabel('Time (s)');
subplot(212);
plot(ndim,acc*100);
axis([2 14 0 1]);
title('Dimensions versus accuracy')
ylabel('% responses correct')
xlabel('Number of dimensions used in gaussian mixture model');
