octave-maintainers
[Top][All Lists]
Advanced

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

1D NDArray -> octave_value


From: John W. Eaton
Subject: 1D NDArray -> octave_value
Date: Thu, 14 Dec 2006 10:51:49 -0500

On 14-Dec-2006, Teemu Ikonen wrote:

| I wrote some oct-functions which return NDArray values by calling
| something like return octave_value(nda).squeeze() (see
| octave-forge/extra/xraylib for the code)
| 
| For arrays with ndims > 1 this seems to work fine, but for 1D arrays
| the returned value is a hybrid between 1D and the 2D. If t is a 1D
| value returned by my function, then
| 
| octave:51> ndims(t)
| ans =  2
| 
| but
| 
| octave:53> size(t)
| ans =  100
| 
| i.e. the one element result vector shows that t is really only
| one-dimensional.

It should not be possible to create 1-d vectors in Octave, so this may
be a bug.  Are you using the CVS sources?  Can you please post a short
example that shows precisely how a vector like this can be created?

Thanks,

jwe


reply via email to

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