## How to write Matlab’s dot operators in mathematical expressions?

### Remember to vote up questions/answers you find interesting or helpful (requires 15 reputation points)

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?

-

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/…) 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 2010 at 18:12
Thanks for the comment. I followed the link to APL; it is interesting! – daizhuo Jul 20 2010 at 2:06

## 2 Answers

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

-

### You can accept an answer to one of your own questions by clicking the check mark next to it. This awards 15 reputation points to the person who answered and 2 reputation points to you.

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.

-

Oh thanks for your response! But are there more compact ways to write these facts? – daizhuo Jul 19 2010 at 17:57
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 9, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.91361004114151, "perplexity_flag": "middle"}