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