MATLAB: Insert elements into vector

cell array

I have a vector 'index' and 'val_index'
index = [1;2;4;5;6;8;9];
index_val = [11;25;3;4;56;7;9];
I remove indices 3 and 7 from the 'index' . The 'removed_index' which I have is the cell array.
removed_index = {[7],[3]};
removed_val = {[1.1],[3.2]};
I want to insert removed indices and the values to the 'index'
Result should be:
index_all = [1;2;3;4;5;6;7;8;9];
index_val_all = [11;25;3.2;3;4;56;1.1;7;9];

Best Answer

index = [1;2;4;5;6;8;9];
index_val = [11;25;3;4;56;7;9];
removed_index = [7,3]; % simpler to use a numeric array

removed_val = [1.1,3.2]; % simpler to use a numeric array
Then all you need is:
idx = [index(:);removed_index(:)];
vec = [index_val(:);removed_val(:)];
vec(idx) = vec
idx(idx) = idx