From octave-sources-request at bevo dot che dot wisc dot edu Sun Sep 5 06:26:24 1999 Subject: Struct tools From: etienne grossmann To: octave-sources at bevo dot che dot wisc dot edu CC: etienne at isr dot ist dot utl dot pt Date: Sun, 5 Sep 1999 12:25:55 +0100 (WEST) Hello, this is a slight amelioratin over the struct functions that I sent on Aug-12-1999 : I have added a "fields" and a "cmpstruct" function. Shall I post it here? Can you see any required modifications? Cheers, Etienne ## f = fields(s) ## ## if version >= 2.1.14 ## Returns the list of fieldnames in structure s. ## Returns an empty list if s is not a struct. ## else ## Returns a string array of fieldnames in structure s. ## Returns '' if s is not a struct. ## ## Force the string behavior with : ## ## f = fields(s,'string') ## Returns a string array of fieldnames in structure s. ## Returns '' if s is not a struct. ## ## For m****b compatibility and flexibility. ## c = cmpstruct(s1,s2) ## ## Compares two structs, returning 1 if they are equal, 0 otherwise. ## ## Will work only if fields of s1 and s2 can be compared through the ## '==' operator. ##