Re: Using implicit information about row indices
- To: mathgroup at smc.vnet.net
- Subject: [mg68329] Re: Using implicit information about row indices
- From: "dkr" <dkrjeg at adelphia.net>
- Date: Tue, 1 Aug 2006 07:00:01 -0400 (EDT)
- References: <eakcj6$qce$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Mark, The following could use some polishing, but should give you the basic idea: In[1]:= r=5; L={{{1,a},{2,b}},{{1,c},{2,d},{3,e},{4,f}},{{2,g},{3,h},{4,i}},{{3,k},{4, l},{5,m}},{{4,n},{5,p}}}; (Evaluate@Table[M[#1,j], {j,#2[[1,1]],Last[#2][[1]]}]=#2[[All,2]])&@@@ Thread[{Range[r],L}]; M[i_,j_]=0; In[5]:= Table[M[w,j],{w,5},{j,5}] Out[5]= {{a,b,0,0,0},{c,d,e,f,0},{0,g,h,i,0},{0,0,k,l,m},{0,0,0,n,p}} dkr