comparison doc/interpreter/matrix.texi @ 2653:e7908588548a

[project @ 1997-02-01 16:53:52 by jwe]
author jwe
date Sat, 01 Feb 1997 16:57:10 +0000
parents 80a42c3fefc9
children 18192eea4973
comparison
equal deleted inserted replaced
2652:69613a17f51a 2653:e7908588548a
1 @c Copyright (C) 1996 John W. Eaton 1 @c Copyright (C) 1996 John W. Eaton
2 @c This is part of the Octave manual. 2 @c This is part of the Octave manual.
3 @c For copying conditions, see the file gpl.texi. 3 @c For copying conditions, see the file gpl.texi.
4 4
5 @node Matrix Manipulation, String Functions, Special Matrices, Top 5 @node Matrix Manipulation, Special Matrices, Plotting, Top
6 @chapter Matrix Manipulation 6 @chapter Matrix Manipulation
7 7
8 There are a number of functions available for checking to see if the 8 There are a number of functions available for checking to see if the
9 elements of a matrix meet some condition, and for rearranging the 9 elements of a matrix meet some condition, and for rearranging the
10 elements of a matrix. For example, Octave can easily tell you if all 10 elements of a matrix. For example, Octave can easily tell you if all
83 errorcode is 1, and @var{y_i} is @var{x_i}. For example, 83 errorcode is 1, and @var{y_i} is @var{x_i}. For example,
84 84
85 @example 85 @example
86 @group 86 @group
87 [errorcode, a, b] = common_size ([1 2; 3 4], 5) 87 [errorcode, a, b] = common_size ([1 2; 3 4], 5)
88
88 @result{} errorcode = 0 89 @result{} errorcode = 0
89 @result{} a = [1 2, 3 4] 90
90 @result{} b = [5 5; 5 5] 91 @result{} a = [ 1, 2; 3, 4 ]
92
93 @result{} b = [ 5, 5; 5, 5 ]
91 @end group 94 @end group
92 @end example 95 @end example
93 96
94 @noindent 97 @noindent
95 This is useful for implementing functions where arguments can either 98 This is useful for implementing functions where arguments can either
250 equivalent statements: 253 equivalent statements:
251 254
252 @example 255 @example
253 @group 256 @group
254 rot90 ([1, 2; 3, 4], -1) 257 rot90 ([1, 2; 3, 4], -1)
258 @equiv{}
255 rot90 ([1, 2; 3, 4], 3) 259 rot90 ([1, 2; 3, 4], 3)
260 @equiv{}
256 rot90 ([1, 2; 3, 4], 7) 261 rot90 ([1, 2; 3, 4], 7)
257 @end group 262 @end group
258 @end example 263 @end example
259 @end deftypefn 264 @end deftypefn
260 265