【问题标题】:Octave efficient way to repeat an array八度重复数组的有效方法
【发布时间】:2020-01-15 13:20:22
【问题描述】:

您好,我在 Octave 中有一个二维数组,在代码中称为 Sig,我想重复复制它以形成该数组的一定数量的循环。我写的方法很有效,但速度很慢,我是否错过了加快速度的技巧?

Cycles=262800
Sig_1=Sig
for i=1:1:Cycles-1;
Sig_1=[Sig_1;Sig];
endfor

【问题讨论】:

    标签: octave cycle


    【解决方案1】:

    你可以使用repmat:

    Sig_1 = repmat(Sig, [Cycles, 1])
    

    【讨论】:

      猜你喜欢
      • 2012-10-01
      • 1970-01-01
      • 2012-04-18
      • 2018-04-02
      • 1970-01-01
      • 1970-01-01
      • 2012-04-15
      • 2010-12-04
      • 2019-07-31
      相关资源
      最近更新 更多