how to append 1 array with half the elements of second array?

2 ビュー (過去 30 日間)
Ashutosh Atre
Ashutosh Atre 2015 年 9 月 6 日
回答済み: Walter Roberson 2015 年 9 月 6 日
I have 2 arrays Arr1=[2 3 4 5] and arr2=[6 7 8 9 10 12] with C=number of elements in arr2 (here, it is 6). So, I want to append array1 with half the elements of array2 e.g arr1=arr1+arr2[C/2]?

採用された回答

Walter Roberson
Walter Roberson 2015 年 9 月 6 日
arr1 = [arr1, arr2(1:end/2)]

その他の回答 (0 件)

タグ

タグが未入力です。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by