I have the arrays z_index = [2 3] and y_index = [4 1 5]. They store the indices of a main array x. z(z_index) = [1 3] and y(y_index) = [-2 4 2]. How do I code to find the array x = [4 1 3 -2 2] which merges the z and y arrays based on the index arrays z_index and y_index?
MATLAB: Merging two arrays based on index arrays
arrayMATLABmatrixmatrix array
Related Question
- Exercise: Add 3 to just the odd elements of x=[2 5 1 6]
- Accessing indexed values in a 3D array
- Group a Array Elements
- Subscript indices must either be real positive integers or logicals.
- Do I get “Array indices must be positive integers or logical values” error when using
- Is it possible to rewrite these equation set to matrix form
Best Answer