Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Problem Using Matwrite, "unrecognized command" error


From   Joerg Luedicke <joerg.luedicke@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Problem Using Matwrite, "unrecognized command" error
Date   Fri, 15 Apr 2011 21:36:54 -0400

On Fri, Apr 15, 2011 at 2:58 AM, J Taylor <jwtayl@gmail.com> wrote:
> I am trying to use a user-written code, Matwrite, for converting Stata
> to Matlab.  Although it is user-written, I was hoping it would be
> frequently enough used by Stata listers to ask a question, as I have
> not been able to get it to work, and keep getting the error
> "unrecognized command"
>
> I am using Stata 11 on PC.  First, I verify once again that I have
> install Matwrite on computer.  I type in "ssc install matwrite,
> replace", and Stata shows the following:
>
> . ssc install matwrite, replace
> checking matwrite consistency and verifying not already installed...
> all files already exist and are up to date.
>
> Next, here is some toy code that I try to call matwrite:
>
> clear
> set obs 5000
> set seed 1234
> gen x = uniform()
> gen y = 2*x + invnormal(uniform())
> matwrite x y using c:\matlabfile, replace
>
> The last line yields the error: "unrecognized command."
>
> I am not sure why it says this.  If I just type matwrite, it tells me
> "using required", as 'using' is a required option for matwrite, so
> Stata seems to recognize matwrite somewhere on my computer.  In
> addition, an "unrecognized command" error is different from when you
> spell something incorrectly / you call something which is not
> installed.  For example, if I type "reg_ress" into Stata, I get the
> error "unrecognized command:  reg_ress".
>
> Does anyone know why I am receiving this error, and if so, how I might fix it?
>

I tried your code (see below) and get no error message. So the problem
seems to lie on your end. Maybe get rid of all matwrite files manually
and install the package again.

J.

. clear

. set obs 5000
obs was 0, now 5000

. set seed 1234

. gen x = uniform()

. gen y = 2*x + invnormal(uniform())

.
end of do-file

. matwrite x y using c:\matlabfile, replace
(note: file c:\matlabfile.mat not found)
file c:\matlabfile.mat saved

*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index