help-octave
[Top][All Lists]
Advanced

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

Re: How to extract all variables from a structure


From: c.
Subject: Re: How to extract all variables from a structure
Date: Fri, 29 Mar 2013 07:12:16 +0100

On 29 Mar 2013, at 03:05, Terry Duell <address@hidden> wrote:

> Can someone please give me a clue as to how I should tackle that?

try this:

>> s = struct ("a", 1, "b", 2, "c", 3)
s =

  scalar structure containing the fields:

    a: 1x1 scalar
    b: 1x1 scalar
    c: 1x1 scalar

>> for [value, name] = s
assignin ('caller', name, value);
endfor
>> a
a =  1
>> b
b =  2
>> c
c =  3
>> 

HTH,
c.



reply via email to

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