Skip to content

Instantly share code, notes, and snippets.

@singularitti
Last active June 17, 2022 13:45
Show Gist options
  • Save singularitti/a8c7592baebdbe240af8f33280dd428d to your computer and use it in GitHub Desktop.
Save singularitti/a8c7592baebdbe240af8f33280dd428d to your computer and use it in GitHub Desktop.
Interlace (interleave) two arrays in Julia / Combine two arrays with alternating elements
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