Take the 2-minute tour ×
MathOverflow is a question and answer site for professional mathematicians. It's 100% free, no registration required.

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|improve this question
1  
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. (en.wikipedia.org/wiki/APL_%28programming_language%29) 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
add comment

2 Answers 2

up vote 3 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$.

See: http://en.wikipedia.org/wiki/Matrix_multiplication#Hadamard_product

share|improve this answer
add comment

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|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
add comment

Your Answer

 
discard

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.