Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Mathematica 6.0 and MatrixManipulations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76313] Re: Mathematica 6.0 and MatrixManipulations
  • From: Mark Fisher <mark at markfisher.net>
  • Date: Sat, 19 May 2007 04:46:41 -0400 (EDT)
  • References: <f2h9ve$1g0$1@smc.vnet.net> <f2jvp3$do4$1@smc.vnet.net>

I see. And one can overload DiagonalMatrix to produce block-diagonal 
matrices:

unprotected = Unprotect[DiagonalMatrix];
DiagonalMatrix[listOfBlocks : {__?MatrixQ}] :=
   Block[{x}, With[{a = Array[x, Length[listOfBlocks]]},
        ArrayFlatten[DiagonalMatrix[a] /. Thread[a -> listOfBlocks]]
   ]]
Protect[unprotected//Evaluate];

m1 = {{1,2},{3,4}};
m2 = {{5,6,7},{8,9,10},{11,12,13}};

DiagonalMatrix[{m1,m2}]

--Mark

Michael wrote:
> Hmm ...
> 
> Yesterday, after perusing version 6.0, it appears that "ArrayFlatten"
> and "ConstantArray" are two new commands to be aware of.  In the
> online documentation, ArrayFlatten also will work with implicitly-
> defined dimensions for zero matrices, such as the following case:
> 
> In1:= m = {{a,b},{c,d}};
> In2:= newMat=ArrayFlatten[{{0,m,0},{0,0,m}}];
> 
> Neat!
> 
> Regards,
> 
> Michael
> 
> On May 17, 3:15 am, Michael <mcau... at gmail.com> wrote:
>> Hi,
>>
>> In Mathematica 6.0, I notice that the instruction
>>
>> In[1]:=  Needs["LinearAlgebra`MatrixManipulation`"];
>>
>> produces the following warning:
>>
>> "General::obspkg: LinearAlgebra`MatrixManipulation` is now obsolete.
>> The legacy version being loaded may conflict with current Mathematica
>> functionality. See the Compatibility Guide for updating information."
>>
>> In fact, a lot of my 'favourite' methods, "BlockMatrix", "ZeroMatrix",
>> etc. no longer are even documented in the help browser, nor is the
>> package MatrixManipulation.
>>
>> My previous version was Mathematica 5.2, and so what *should* I be
>> using now instead of "BlockMatrix", "ZeroMatrix", etc.?  Thus far, I
>> haven't been able to find any information about obsolesced functions
>> within the help browser (F1).
>>
>> Any suggestions or help would be greatly appreciated!
>>
>> Thanks,
>>
>> Michael
> 
> 
> 


  • Prev by Date: Hankel transformation // Fourier transformation for a circular function
  • Next by Date: Re: Re: Dynamic PlotLabel in Math6?
  • Previous by thread: Re: Mathematica 6.0 and MatrixManipulations
  • Next by thread: how save newly created palette?