Prev: Matlab code to solve GPL algorithm for the shortest path problem with time windows
Next: AIC SBC
From: Conrad on 2 Jul 2010 23:34 Hi, I have the following structure: example.a1.b=1; example.a22.b=2; example.a333.b=3; f={'a1','a22','a333'}; I'm trying to access the b field from each example: a=example.(f{:}).b Is there a way to do this? Thank you
From: Matt Fig on 3 Jul 2010 02:24 B = structfun(@(x) x.b,example) % Read the help for STRUCTFUN
From: Conrad on 3 Jul 2010 16:01 "Matt Fig" <spamanon(a)yahoo.com> wrote in message <i0ml24$nhl$1(a)fred.mathworks.com>... > B = structfun(@(x) x.b,example) % Read the help for STRUCTFUN Thanks. Matlab is brillant and so is this newsgroup of course!
From: us on 3 Jul 2010 18:59 "Conrad " <conrad7(a)gmx.net> wrote in message <i0o4u1$f30$1(a)fred.mathworks.com>... > "Matt Fig" <spamanon(a)yahoo.com> wrote in message <i0ml24$nhl$1(a)fred.mathworks.com>... > > B = structfun(@(x) x.b,example) % Read the help for STRUCTFUN > > Thanks. Matlab is brillant and so is this newsgroup of course! nah... not this NG... MATT FIG... he's brilliant... us
From: Matt Fig on 3 Jul 2010 19:15 "us " <us(a)neurol.unizh.ch> wrote in message <i0ofbp$k62$1(a)fred.mathworks.com>... > "Conrad " <conrad7(a)gmx.net> wrote in message <i0o4u1$f30$1(a)fred.mathworks.com>... > > "Matt Fig" <spamanon(a)yahoo.com> wrote in message <i0ml24$nhl$1(a)fred.mathworks.com>... > > > B = structfun(@(x) x.b,example) % Read the help for STRUCTFUN > > > > Thanks. Matlab is brillant and so is this newsgroup of course! > > nah... not this NG... MATT FIG... he's brilliant... > > us LOL, if it wasn't for the abundant evidence to the contrary which has been permanently archived in old threads, I might agree with you ;-)
|
Pages: 1 Prev: Matlab code to solve GPL algorithm for the shortest path problem with time windows Next: AIC SBC |