Marco Gavanelli wrote: > To insert a column, you can first transpose the matrix, and then insert > a row. > > If it is not convienent to transpose the matrix, then if you are using the structure of structure representation Marco mentioned, you can directly set the column elements by accessing each row and setting the appropriate column element, e.g. set_col(Col, N, M) :- % set the column N of matrix M to the values in Col (foreacharg(Row, M), foreacharg(E, Col), param(N) do arg(N, Row, E) ). [eclipse 16]: dim(M, [3,4]), set_col([](1,2,3),2,M). M = []([](_270, 1, _272, _273), [](_265, 2, _267, _268), [](_260, 3, _262, _263)) Yes (0.00s cpu) [eclipse 17]: Cheers, KishReceived on Mon Dec 03 2007 - 23:12:05 CET
This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET