interleave

버전 1.0.0.0 (987 Bytes) 작성자: Jason Blackaby
Interleave two vectors
다운로드 수: 3.3K
업데이트 날짜: 2007/10/18

라이선스 없음

This function simply interleaves two vectors. The vectors can be of different lengths. If one vector is longer, the leftover elements are just appended to the output vector. This can be done in a couple of lines if the vector lengths are known, but this function handles most of the possibilities automatically, and should save a few minutes.

Example:
z = interleave([1 2 3 4], [5 6 7 8 9 10])
= 1 5 2 6 3 7 4 8 9 10

인용 양식

Jason Blackaby (2026). interleave (https://kr.mathworks.com/matlabcentral/fileexchange/16919-interleave), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2007a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Interleaving에 대해 자세히 알아보기
도움

도움 준 파일: Interleave Vectors or Matrices

버전 게시됨 릴리스 정보
1.0.0.0

Followed John's suggestion to just return the other vector if one is empty instead of returning an error. Also, if both are empty, an empty vector is returned.