struct behaves differenly in octave and matlab

david wlmd888 at yahoo.com
Mon May 4 10:23:52 CDT 2009


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


      



More information about the Help-octave mailing list