help-octave
[Top][All Lists]
Advanced

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

How to modify structure fields inside functions


From: Bruno Picasso
Subject: How to modify structure fields inside functions
Date: Fri, 6 Apr 2012 11:23:39 +0200

Hi everybody,

I need your help to understand how to modify a structure field inside a function. For example:

>> a.b=3
a =
{
  b =  3
}

>> function modify (s)
> setfield(s,'b',5)
> endfunction

>> modify(a)
ans =
{
  b =  5
}

>> a.b
ans =  3


Thanks for your kind help

Bruno

reply via email to

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