Sin licencia
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
Citar como
Jason Blackaby (2024). interleave (https://www.mathworks.com/matlabcentral/fileexchange/16919-interleave), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
Etiquetas
Agradecimientos
Inspiración para: Interleave Vectors or Matrices
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
Versión | Publicado | Notas de la versión | |
---|---|---|---|
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. |