Conditions
- To: mathgroup at smc.vnet.net
- To: mathgroup at smc.vnet.net
- Subject: [mg29240] Conditions
- From: Yannis.Paraskevopoulos at ubsw.com
- Date: Thu, 7 Jun 2001 01:14:46 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hi again,
I've been puzzled by the following problem which I have to admit it's
not complicated but yet...
assume that we have a matrix m with dimensions (RxC) then create a
vector v, which has value 0 when there is a zero at any point across
m's row. Otherwise v's value would be equal to the last value of the
corresponding m row.
I tried for example:
I initiated a vector v={a,b}. I had to that as
Table[If[m[[i,j]]==0,v[[i]]=0,v[[i]]=g[[i,5]]],{i,2},{j,5}];
v
Out:= {1,1} when I expected {0,1}
I also tried
v:=0 /; g/.x_:>x==0
v:=Table[g[[i,5]],{i,2}]
with same results.
Its obvious to me that I do something stupid but I can't figure it out.
Any help would be very much appreciated.
Best regards
yannis
Visit our website at http://www.ubswarburg.com
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.