Trouble modif. Matrix in function
- To: mathgroup at smc.vnet.net
- Subject: [mg29068] Trouble modif. Matrix in function
- From: "Nicola" <nicola-mingotti at nospam-libero.it>
- Date: Sat, 26 May 2001 21:54:04 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hello , I'm new to the comp.soft-sys.math.mathematica so I hope this question has not been asked many time yet :) So : Defining TavGen[n_] := Table[ Table[1, {i, 1, p}], {p, 1, n}] TAB = TavGen[6] Function 1) works , 2) does not work *********************************************** 1) Elim[Rig_, Pos_, Offset_:0] := (TAB[[Rig, #]] = 0) & /@ Table[i, {i, Pos, Pos + Offset}] ************************************************* ************************************************* 2) ElimG[P_, Rig_, Pos_, Offset_:0] := (P[[Rig, #]] = 0) & /@ Table[i, {i, Pos, Pos + Offset}] ************************************************* ElimG[TAB, 3, 2] this gives me : Set::"setps": "\!\({\(\({1}\)\), \(\({1, 1}\)\), \(\({1, 0, 1}\)\), \(\({1, \ 1, 1, 1}\)\), \(\({1, 1, 1, 1, 1}\)\), \(\({1, 1, 1, 1, 1, 1}\)\)}\) in \ assignment of part is not a symbol." ************************************************** I tried using a For instead of a Map but nothing changes :( Thanks in advance for your help . Please excuse my poor explanations and English . Bye.