MathGroup Archive 2008

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

Search the Archive

Re: Multiplication of matrices

  • To: mathgroup at
  • Subject: [mg89132] Re: Multiplication of matrices
  • From: Roland Franzius <roland.franzius at>
  • Date: Mon, 26 May 2008 06:24:09 -0400 (EDT)
  • References: <g1di51$9r5$>

TomᨠProcházka schrieb:
> Hi,
> does anyone know how to simplify expressions like
> A.((-1)*B)
> or A.(5B)
> with A and B (general) matrices to expressions like
> -A.B
> 5 A.B
> I am sorry for such a stupid question :-) Thanks!

A general method to gather products of numbers in front of multilinear 
operations is

expr //.
{HoldPattern[Dot[a___, b_?NumericQ*c_, d___]] :> b*Dot[a, c, d]}


Roland Franzius

  • Prev by Date: Integrate vs NIntegrate
  • Next by Date: Re: No Show
  • Previous by thread: Multiplication of matrices
  • Next by thread: Re: Multiplication of matrices