MathGroup Archive 2006

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

Search the Archive

Re: How to delete a row and a column in a matrix?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69724] Re: How to delete a row and a column in a matrix?
  • From: "dkr" <dkrjeg at adelphia.net>
  • Date: Thu, 21 Sep 2006 07:31:36 -0400 (EDT)
  • References: <eeqqlr$onu$1@smc.vnet.net>

In[71]:=
del[a_List,row_Integer,col_Integer]:=

Module[{z},z=a;z[[row]]=Sequence[];z=Transpose[z];z[[col]]=Sequence[];
      Transpose[z]];
In[72]:=
delAlt[a_List,row_Integer,col_Integer]:=

Module[{z,x},z=a;z[[row]]=Sequence[];x=z;x[[All,col]]=Sequence[];x];

In[76]:=
alist={{1,2,3},{4,5,6},{7,8,9}};

In[77]:=
del[alist,1,2]
Out[77]=
{{4,6},{7,9}}

delAlt[alist,1,2]
Out[62]=
{{4,6},{7,9}}

dkr


  • Prev by Date: Re: Inequalities
  • Next by Date: RE: Inequalities
  • Previous by thread: Re: How to delete a row and a column in a matrix?
  • Next by thread: Re: How to delete a row and a column in a matrix?