2
$\begingroup$

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?

$\endgroup$
2
  • 1
    $\begingroup$ 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. $\endgroup$
    – Dan Piponi
    Commented Jul 19, 2010 at 18:12
  • $\begingroup$ Thanks for the comment. I followed the link to APL; it is interesting! $\endgroup$
    – daizhuo
    Commented Jul 20, 2010 at 2:06

2 Answers 2

4
$\begingroup$

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

$\endgroup$
1
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ Oh thanks for your response! But are there more compact ways to write these facts? $\endgroup$
    – daizhuo
    Commented Jul 19, 2010 at 17:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .