help-octave
[Top][All Lists]
Advanced

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

Is modifying structures using a string possible?


From: injoi
Subject: Is modifying structures using a string possible?
Date: Fri, 5 Oct 2012 14:28:28 -0700 (PDT)

Is it possible to modify a structure so that its field names are defined by
inputs in a string?

example:

eString = {'dogs','cats','birds'};

for i = 1:length(eString)

animals.eString(i) = i;
end

*then the desired output would be..
animals.dogs = 1
animals.cats = 2
animals.birds = 3

I have been trying do this for a while with no luck. Any suggestions?



-----
Windows 7, intel Xeon(R) 3.3GHz

Thanks, Nohtal
--
View this message in context: 
http://octave.1599824.n4.nabble.com/Is-modifying-structures-using-a-string-possible-tp4645065.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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