MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

checking for a particular value in a matrix

  • To: mathgroup at smc.vnet.net
  • Subject: [mg30933] checking for a particular value in a matrix
  • From: Au Han Bin <auhb3 at cz3.nus.edu.sg>
  • Date: Thu, 27 Sep 2001 02:16:52 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi, I am a programming newbie and I need advice on how to check that a
table or matrix , for all nonzero entries in a given row, has only one
entry of value 1.



i have another query on why the code below does not work, when i call
convert{1,0,0,0} again, the results given are from an earlier question,
e.g. {1,1} is it initialised wrongly?


Clear[a,convert];
convert[a___] = Sum[a[[i]]*2^(Length[a]-i),{i,1,Length[a]}]

regards, thanks,

joshua


  • Prev by Date: Re: Open Write?
  • Next by Date: Re: Dynamic Visualizer Package for 4.1?
  • Previous by thread: Re: Mathematica as a word processor
  • Next by thread: Re: checking for a particular value in a matrix