Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Matrix manipulation
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: Matrix manipulation
Date
Wed, 23 Mar 2011 10:32:43 +0000
Why introduce c?
: a = 80, 100, 40 \ 10, -6, 7
: a :/ a[,1]
1 2 3
+----------------------+
1 | 1 1.25 .5 |
2 | 1 -.6 .7 |
+----------------------+
On Wed, Mar 23, 2011 at 10:23 AM, Brendan Halpin <[email protected]> wrote:
> On Wed, Mar 23 2011, Maarten buis wrote:
>
>> *------------- begin example ------------
>> mata
>> a = 80, 100, 40 \ 10, -6, 7
>> c = 80 \ 10
>> a :/ c
>> end
>> *-------------- end example -------------
>
> Or more generally,
>
> mata
> a = 80, 100, 40 \ 10, -6, 7
> c = a[,1]*J(1,cols(a),1)
> a :/ c
> end
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/