Combining two arrays using a seconds order
1 次查看(过去 30 天)
显示 更早的评论
I have two arrays.
number = [8 9 4 1 2 3 6 7 10 5]
number2 = [5 1 6 7 3 4 10 9 8 2]
I would like to replace the first 5 values of number (8 9 4 1 2)
with the same order for these values in number2 (1 4 9 8 2). So the revised number will be [1 4 9 8 2 3 6 7 10 5] as the next five numbers will not change.
Thanks in advance
2 个评论
Rik
2024-2-18
Should it only be the first 5 values?
You can use the ismember function to do this. What have you tried so far?
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!