Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

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

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg567] Re: [mg551] how to pick out alternating columns and rows in a matrix?
  • From: bob at zim.uoregon.edu (Robert Zimmerman)
  • Date: Sat, 18 Mar 95 18:46:59 -0800


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?