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
- Follow-Ups:
- Re: checking for a particular value in a matrix
- From: Tomas Garza <tgarza01@prodigy.net.mx>
- Re: checking for a particular value in a matrix