comparison scripts/miscellaneous/getfield.m @ 8507:cadc73247d65

style fixes
author John W. Eaton <jwe@octave.org>
date Tue, 13 Jan 2009 14:08:36 -0500
parents a1dbe9d80eee
children eb63fbe60fab
comparison
equal deleted inserted replaced
8506:bc982528de11 8507:cadc73247d65
20 ## @deftypefn {Function File} {[@var{v1}, @dots{}] =} getfield (@var{s}, @var{key}, @dots{}) 20 ## @deftypefn {Function File} {[@var{v1}, @dots{}] =} getfield (@var{s}, @var{key}, @dots{})
21 ## Extract fields from a structure. For example 21 ## Extract fields from a structure. For example
22 ## 22 ##
23 ## @example 23 ## @example
24 ## @group 24 ## @group
25 ## ss(1,2).fd(3).b=5; 25 ## ss(1,2).fd(3).b = 5;
26 ## getfield (ss, @{1,2@}, "fd", @{3@}, "b") 26 ## getfield (ss, @{1,2@}, "fd", @{3@}, "b")
27 ## @result{} ans = 5 27 ## @result{} ans = 5
28 ## @end group 28 ## @end group
29 ## @end example 29 ## @end example
30 ## 30 ##
31 ## Note that the function call in the previous example is equivalent to 31 ## Note that the function call in the previous example is equivalent to
32 ## the expression 32 ## the expression
33 ## 33 ##
34 ## @example 34 ## @example
35 ## i1= @{1,2@}; i2= "fd"; i3= @{3@}; i4= "b"; 35 ## i1 = @{1,2@}; i2 = "fd"; i3 = @{3@}; i4= "b";
36 ## ss(i1@{:@}).(i2)(i3@{:@}).(i4) 36 ## ss(i1@{:@}).(i2)(i3@{:@}).(i4)
37 ## @end example 37 ## @end example
38 ## @seealso{setfield, rmfield, isfield, isstruct, fieldnames, struct} 38 ## @seealso{setfield, rmfield, isfield, isstruct, fieldnames, struct}
39 ## @end deftypefn 39 ## @end deftypefn
40 40
41 ## Author: Etienne Grossmann <etienne@cs.uky.edu> 41 ## Author: Etienne Grossmann <etienne@cs.uky.edu>