help-octave
[Top][All Lists]
Advanced

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

Re: equivalent for C-style init: structname varname[] = {...} ?


From: Jordi Gutiérrez Hermoso
Subject: Re: equivalent for C-style init: structname varname[] = {...} ?
Date: Thu, 15 Nov 2012 00:27:16 -0500

On 14 November 2012 12:10, Sergei Steshenko <address@hidden> wrote:
> However, if the field is not known in advance or is not a bareword, one needs 
> to use 'setfield', 'getfield' - you saw them in my example.

This is a lie:

   fieldname = "foo";
   varname = 42;
   s = struct();
   s.(fieldname) = varname

- Jordi G. H.


reply via email to

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