MathGroup Archive 1995

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

Search the Archive

Re: how to pick out alternating columns and rows in a matrix?



Reply to mg551

   Might not be more elegant but here is another solution,

   mat =  Array[a,{6,6}];
 

 ( mat//Flatten)//.
       {a[x_  ,y_?EvenQ ] ->0, a[x_?EvenQ  ,y_ ] ->0}//.
         { head___ ,0, tail___ } :> {head, tail}//
                    Partition[#,3]& //MatrixForm 

 

  

 

a[1, 1]   a[1, 3]   a[1, 5]

a[3, 1]   a[3, 3]   a[3, 5]

a[5, 1]   a[5, 3]   a[5, 5]

Robert L. Zimmerman
Institute of Theoretical Science
University of Oregon
Eugene Oregon 97403


  • Prev by Date: Re: (-1)^(3/4) -> (-1+I)/Sqrt[2]
  • Next by Date: Re: how to pick out alternating columns and rows in a matrix?
  • Previous by thread: how to pick out alternating columns and rows in a matrix?
  • Next by thread: Re: how to pick out alternating columns and rows in a matrix?