Last active
June 17, 2022 13:45
-
-
Save singularitti/a8c7592baebdbe240af8f33280dd428d to your computer and use it in GitHub Desktop.
Interlace (interleave) two arrays in Julia / Combine two arrays with alternating elements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://discourse.julialang.org/t/combining-two-arrays-with-alternating-elements/15498/3 | |
# Interleave 2 vectors `a` & `b` to get a new vector | |
collect(Iterators.flatten(zip(a, b))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment