help-octave
[Top][All Lists]
Advanced

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

Re: Is modifying structures using a string possible?


From: Jordi Gutiérrez Hermoso
Subject: Re: Is modifying structures using a string possible?
Date: Fri, 5 Oct 2012 17:37:50 -0400

On 5 October 2012 17:28, injoi <address@hidden> wrote:
> 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;

Change this to animals.(eString{i}) = i;

HTH,
- Jordi G.  H.


reply via email to

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