# RE: st: string calculation

 From tanaka yoshi <[email protected]> To <[email protected]> Subject RE: st: string calculation Date Fri, 18 Jan 2008 06:10:03 +0900

```Dear Bill

Thank you very much for your prompt reply and answer. I really appreciate it.

I understood your answer about my previous quetion, but I have one more question about matrix calculation.
I am really sorry to trouble you again.

First, I define matrix X.

X=("a","b"\"c","d" )

Next, I would like to define Y, which is the inverse matrix of X, in the following form.

is there any command to get the matrix Y, which consists of string expressions???

Thank you very much for your help.

Yoshi

> From: [email protected]
> To: [email protected]
> Subject: Re: st: string calculation
> Date: Thu, 17 Jan 2008 14:26:30 -0600
>
> Tanaka Yoshi  asks,
>
>> I have a question about the matrix calculation in the form of string.
>> [...]
>>
>> . mata
>> : X=("a","b")
>> : Y=("c","d")
>> : Z=X+Y
>> : Z
>> 1 2
>> +-----------+
>> 1 | ac bd |
>> +-----------+
>> : end
>>
>> the result is (ac, bd), but the expression i want to get is (a+c, b+d).
>
> I assume Tanak means that the result is ("ac", "bd") and what he wants
> is ("a+c", "b+d"). One solution is
>
> : Z = X :+ "+" :+ Y
>
> : Z
> 1 2
> +-------------+
> 1 | a+c b+d |
> +-------------+
>
> Above I used the :+ operator, see -help [m2] op_colon-.
>
> Another solution is
>
> : Z = X + ("+", "+") + Y
>
> : Z
> 1 2
> +-------------+
> 1 | a+c b+d |
> +-------------+
>
> -- Bill
> [email protected]
> *
> * For searches and help try:
> * http://www.stata.com/support/faqs/res/findit.html
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/

_________________________________________________________________

http://match.jp.msn.com/channel/index.aspx?avo=1&trackingid=1034447
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```