octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #46385] Can't Repmat Structure Arrays


From: Markus Bergholz
Subject: [Octave-bug-tracker] [bug #46385] Can't Repmat Structure Arrays
Date: Fri, 27 Nov 2015 14:01:29 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0

Follow-up Comment #3, bug #46385 (project octave):

the problem is in reshape, which is called by repmat.


>> M = repmat(struct('a', ones(100), 'b', true), 1, 2);
>> [m,n] = size(M);
>> reshape(M, m, 1, n, 1)

ans = 

1x1x2 struct array with fields:

    a
    b



Octave failed here with a dimension mismatch across fields in struct.

Using repelem from #45497 makes it work without touching reshape.


octave:1> M = repmat(struct('a', ones(100), 'b', true), 1, 2);
octave:2> M = repmat(M, 1, 2)
M =

  1x4 struct array containing the fields:

    a
    b


(file #35577)
    _______________________________________________________

Additional Item Attachment:

File name: repmat.patch                   Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46385>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]