Interweaving vectors

前端 未结 6 1058
傲寒
傲寒 2020-12-06 01:00

I would like to interweave two vectors in MATLAB. In fact, I\'d actually just like to add a zero between each element, but I figured I\'d ask the question in such a way that

6条回答
  •  遥遥无期
    2020-12-06 01:20

    Octave is a free, open source reverse engineering of MatLab where the functionality and language are the same in most cases. However, if you find yourself coding in Octave, you can use the below to interleave two (real valued) row vectors x and y:

    [x;y](:)'
    

    Caveat: this is Octave code and doesn't work in MatLab.

提交回复
热议问题