Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Alan
Posts:
48
Registered:
7/30/13


Operating on similar elements of different structures
Posted:
Jul 30, 2013 11:16 AM


Hello,
I'm new to using structures and have a question on how to interact with them.
Is there a way to do the same operation on the same parts of different structs?
For example, I've been doing something like this in my scripts:
for k = 1:10 struct(k).arraytwo = struct(k).arrayone * 9.81; struct(k).arraythree = struct(k).arrayone > 0; struct(k).arrayfour = cumsum(struct(k).arraythree); ..... end
Is there a way to do this without the for loop? like some clever indexing?
thanks!



