Re: Help
- To: mathgroup at smc.vnet.net
- Subject: [mg28210] Re: Help
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Thu, 5 Apr 2001 03:00:26 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <9aela9$nb1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, mat = Array[m, {4, 6}] vec = Array[s, {6}] q=Transpose[(#1 - #2)/#2 & @@@ Transpose[{Transpose[mat], vec}]] Regards Jens Yannis.Paraskevopoulos at ubsw.com wrote: > > Hi all, > > I would appreciate your help on the following problem: > > assume that we have a matrix m with dimensions (RxC) and a vector s > with dimensions (Rx1). Now what I want is to create another matrix Q > > If m[[i,j]]>s[[i]], then Q=(m[[i,j]]-s[[i]])/s[[i]], for {i,1,R},{j,1,C} > > I'm sure there must be an elegant and fast way to do that. > > Best Regards > > yannis