%%% derive approximate secondary fates after strage by removing %%% "storage" and re-normalising all the other categories accordingly for k=1:total_unu_keys_entire_pool freq_fate_current_unu = allunudata(k).distributions.freq_fate; % cats_primary_fate_current_unu = allunudata(k).distributions.cats_primary_fate; [~,j_storage] = ismember('Storage',cats_primary_fate_current_unu); % locating the zero frequency fate freq_fate_current_unu_not_storage = freq_fate_current_unu; freq_fate_current_unu_not_storage(j_storage) = 0; j_not_storage = find(freq_fate_current_unu_not_storage ~= 0); % locating fates with non-zero frequencies other than storage in the current unu % freq_fate_current_unu_storage = freq_fate_current_unu(j_storage); % freq_fate_current_unu_secondary = zeros(numel(freq_fate_current_unu),1); % allocate memoty for secondary fates pdf freq_fate_current_unu_secondary(j_not_storage) = freq_fate_current_unu(j_not_storage) + freq_fate_current_unu_storage / numel(j_not_storage); % devide the storage fate equally between all other fates freq_fate_current_unu_secondary(j_storage) = 0; % no secondary storage % record into the generic structure allunudata(k).distributions.freq_fate_secondary = freq_fate_current_unu_secondary; end