function resulting_vector = mean_age(ages, pop, profile, growth)

final = numel(pop)-1;
growth_mat = exp(-growth*ages);
resulting_vector = sum(ages.*pop.*profile.*growth_mat)/sum(pop.*profile.*growth_mat);