struct behaves differenly in octave and matlab

Jaroslav Hajek highegg at gmail.com
Mon May 4 10:36:32 CDT 2009


On Mon, May 4, 2009 at 5:23 PM, david <wlmd888 at yahoo.com> wrote:
>
> Hi,
>
>  When I use Octave to do the following:
>
> octave:67> a.b=[]
> a =
> {
>  b = [](0x0)
> }
>
> octave:68> a.b.c.d=1;
> error: matrix cannot be indexed with .
> error: evaluating assignment expression near line 68, column 8
>
>
> The same code in Matlab:
>>> a.b=[]
>
> a =
>
>    b: []
>
>>> a.b.c.d=1;
>>> a.b.c
>
> ans =
>
>    d: 1
>
>
>  My question is: How can we get the same result from Octave to match the result in Matlab?
>
>  Thank you so much!
>
> David
>
>
>

This works in 3.1.55.

cheers


-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



More information about the Help-octave mailing list