help-octave
[Top][All Lists]
Advanced

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

Re: rmfield does not seem to work


From: Bård Skaflestad
Subject: Re: rmfield does not seem to work
Date: Thu, 24 Nov 2011 17:40:47 +0100

On Thu, 2011-11-24 at 17:24 +0100, grg wrote:
> Hi there,
> 
> I am runnig octave-3.2.4 on fedora 14 and rmfield does not seem to be
> working (see example below).
> Am I doing something wrong?

You must assign the result of 'rmfield' to a (possibly new) structure if
you want its effect to be preserved and observable.  For instance

        s = struct("f1", rand(10), "f2", rand(20), "f3", rand(4));
        s2 = rmfield(s, "f1");
        isfield(s2, "f1")
        s3 = rmfield(s, {"f2", "f3"});
        isfield(s3, "f3")
        isfield(s3, "f2")


Sincerely,
-- 
Bård Skaflestad <address@hidden>
SINTEF ICT, Applied Mathematics



reply via email to

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