Inserting Array into Another Array
34 views (last 30 days)
I have three arrays as shown in the code below
z = zeros(25,2); % main array
y = rand(23,1);
a = ones(25,1);
x = [4,16] % positions at which zeros remain in the second column of array z
z(:,1) = a;
I want to insert array y into the second column of array z in all positions apart from given in x, where the zeros should remain.
I have read this answer
but my case is a little different than it. Does anyone knows how to do it?