|
From: | bpabbott |
Subject: | Re: append field to struct array |
Date: | Thu, 22 Jul 2010 08:52:49 -0700 (PDT) |
hi Octavers,
is there a fast way to append a new field to an existing struct array
ie., something that would replace the for loop in the bottom code
octave3.2:1> a(1).a=0; a(2).a=1; a(3).a=2;
octave3.2:2> a
a =
{
1x3 struct array containing the fields:
a
}
octave3.2:3> b=[3,4,5];
octave32:4> for n=1:rows(a),a(n).b=b(n);endfor
when the array is large, the above is quite slow.
thanks, eric
[Prev in Thread] | Current Thread | [Next in Thread] |