how to make a single array out of 2 arrays
    조회 수: 5 (최근 30일)
  
       이전 댓글 표시
    
hi good day, i have given two arrays (odd and even), how can i make it as a one array such that the position of the elements in odd will be in odd and the same for the even array for the new array, thank you in advance 
odd=[0.4357, 0.78208,0.6245]
even=[0.48004,1.29188,1.54668,0.82376]
댓글 수: 0
채택된 답변
  James Tursa
      
      
 2023년 7월 21일
        Just use indexing. E.g.,
odd=[0.4357, 0.78208,0.6245]
even=[0.48004,1.29188,1.54668,0.82376]
both(1:2:5) = odd
both(2:2:8) = even
But for your example the mesh doesn't cover all elements.
추가 답변 (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!

