help-octave
[Top][All Lists]
Advanced

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

cycling over structure elements


From: Mike B.
Subject: cycling over structure elements
Date: Sun, 1 Aug 2010 20:33:33 -0700 (PDT)

Hi All,

Assuming I have a strcutre defined:
s.a = 1;
s.b = 2;

Is it possible to cycle over strucutre elements and to define new variables 
which have a fixed prefix + the structure element name, for example with the 
above structure the pseudo-code is

{cycle over elements of s }
{ for each element define a variable x_<element name> = s.<element name> }

which results in new variables:

x_a = s.a;
x_b = s.b;

Thanks,
Mike.





reply via email to

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