add_to_columns INDEX

ADD_TO_COLUMNS _ _ _ _ _ _ _ _ _ _ _ _ operator

Add to columns, add to rows:

syntax:

add_to_columns(<matrix>,<column\_list>,<expr>)

<matrix> :- a matrix.

<column\_list> :- a positive integer or a list of positive integers.

<expr> :- a scalar expression.

add_to_columnsadds <expr> to each column specified in <column\_list> of <matrix>.

add_to_rowsperforms the equivalent task on the rows of <matrix>.

examples:



add_to_columns(A,{1,2},10); 

  [11  12  3]
  [         ]
  [14  15  6]
  [         ]
  [17  18  9]



add_to_rows(A,2,-x) 

   
  [   1         2         3    ]
  [                            ]
  [ - x + 4   - x + 5   - x + 6]
  [                            ]
  [   7         8         9    ]

Related functions: add_columns, add_rows, mult_rows, mult_columns.