Fwd: [OctDev] Cell array (of structs) to array failure

Jaroslav Hajek highegg at gmail.com
Wed Jun 24 11:40:59 CDT 2009


---------- Forwarded message ----------
From: Travis Collier <travcollier at gmail.com>
Date: Wed, Jun 24, 2009 at 2:21 PM
Subject: [OctDev] Cell array (of structs) to array failure
To: octave-dev at lists.sf.net


I may be doing this completely wrong, but it works in some cases and
used to work reliably (in 3.0.5).

I've got a function returning a cell array of structs or empty
elements which I'm appending to form a single array of structs.
cors = [cors c{:}]
This used to work, and still does most of the time.

In fact, just [c{:}] is failing sometimes with the same error...
error: octave_base_value::complex_array_value(): wrong type argument `struct'

Any clue as to the problem, or suggestion how to do this sort of
append differently (or better)?

Sorry, I can't seem to duplicate the results with very simple
inputs... they all seem to work.
I'm attaching a saved variable "c" which fails.

Here is as trimmed down a version as I can get:
octave:254> c{:}
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans =
                       {
                         maxlag =  17628
                       }

                       ans = [](0x0)
                       ans =
                       {
                         maxlag =  17604
                       }

                       ans =
                       {
                         maxlag =  17612
                       }

                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans = [](0x0)
                       ans =
                       {
                         maxlag =  27
                       }

                       ans =
                       {
                         maxlag =  27
                       }

                       ans = [](0x0)
                       ans = [](0x0)
octave:255> [c{:}]
error: octave_base_value::complex_array_value(): wrong type argument `struct'

------------------------------------------------------------------------------

_______________________________________________
Octave-dev mailing list
Octave-dev at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev




-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bad_c.dat
Type: application/x-ns-proxy-autoconfig
Size: 2517 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/bug-octave/attachments/20090624/da22ad1b/attachment.bin 


More information about the Bug-octave mailing list