Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*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 2006

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

Search the Archive

Re: mathematica newbie question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg66893] Re: mathematica newbie question
  • From: dh <dh at metrohm.ch>
  • Date: Sat, 3 Jun 2006 03:25:09 -0400 (EDT)
  • References: <e5osv8$i51$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Jeremy,
Scalar operators applied to a matrix act on elements. Therefore, you get 
a matrix with the squared elements.
If you want to use matrix arithmetics, you need matrix operators like:
Dot .,MatrixPower, MatrixExp e.t.c
see manual

Daniel

Jeremy Watts wrote:
> Hi,
> 
> Just trying to get to grips with Mathematica and matrices.  Why is it when I
> enter :-
> {0, 0, 0}, {1, -1, -1}, {-1, 1, 1}}^2
> 
> then Mathematica returns :-
> 
> {{0, 0, 0}, {1, 1, 1}, {1, 1, 1}}
> 
> and not {{0,0,0},{0,0,0},{0,0,0}} (the actual square of the matrix) as I'd
> have expected?
> 
> Is it treating what I entered as separate vectors or something, and not  an
> actual matrix?
> 
> Thanks
> 
> 


  • Prev by Date: Re: mathematica newbie question
  • Next by Date: Re: calling mathematica functions from a c++ program
  • Previous by thread: Re: mathematica newbie question
  • Next by thread: Re: mathematica newbie question