MathOverflow is a question and answer site for professional mathematicians. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Matlab has a set of dot operators, such as .*, ./, .^. Each of these operators consists of a dot and a normal algebraic operator. They perform element-wise algebraic operations on a matrix. For example, consider the following codes

A = [1 2 3; 3 2 1];
x = [1 2 4];

B = A.^2
y = 1./x

The result is

B =

     1     4     9
     9     4     1

y =

     1.0000    0.5000    0.2500

I find these dot operators very convenient. My question is, how to write these dot operators in mathematical expressions? (By mathematical expressions, I mean the expressions used in proofs.)

EDIT - One obvious way is to define the result matrix element-wise. But is there a way to write this result in a more compact manner?

share|cite|improve this question
The Matlab notation was heavily influenced by APL. APL was intended originally as a compact notation for doing mathematics. As a result, for the kinds of operations operations you appear to be talking about, the usual mathematical notation is typically going to be longer than the Matlab code. ( But bear in mind, you're free to write $y=1/x$ to mean $y_k=1/x_k$ in a proof, as long as you state your intentions clearly and unambiguously. – Dan Piponi Jul 19 '10 at 18:12
Thanks for the comment. I followed the link to APL; it is interesting! – daizhuo Jul 20 '10 at 2:06
up vote 4 down vote accepted

Your matrix $B$ is the Hadamard product of $A$ and $A$ which uses the notation $B = A \circ A$. However I don't know of any others, particularly for expressing $y$.


share|cite|improve this answer

I might write those as $B_{ij} = (A_{ij})^2$ and $y_k = \frac{1}{x_k}$ (where i, j and k range over the rows and columns of A and the elements of x respectively). Of course, I'm sure other ways exist too.

share|cite|improve this answer
Oh thanks for your response! But are there more compact ways to write these facts? – daizhuo Jul 19 '10 at 17:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.