% This does what I want...but do you know of a quicker way?
X = [2 1 0 4 5 0 778 90 0 3 88 0 77 66 0 12 23 0 45 80 0 89 67 0 34 67 0 76 32 0];
% Find indices of zeros in X
zero_indices = find(X == 0);
% Calculate additional 0s to insert (20% of the total number of 0 in X)
num_existing_zeros = length(zero_indices);
num_additional_zeros = round(0.2 * num_existing_zeros);
% Randomly select positions following existing 0s
additional_zero_positions = randsample(num_existing_zeros, num_additional_zeros);
% Sort 'em
additional_zero_positions = sort(additional_zero_positions);
% Insert 0s
for i = 1:num_additional_zeros
insert_index = zero_indices(additional_zero_positions(i)) + i;
X = [X(1:insert_index+1) 0 X(insert_index+2:end)];
zero_indices = zero_indices + 1;
end