Bookmark and Share

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: Problem Using Matwrite, "unrecognized command" error


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Problem Using Matwrite, "unrecognized command" error
Date   Sun, 17 Apr 2011 09:29:33 +0100

I tried this with Windows XP and everything worked.

You should confirm that

1. matwrite.plugin is also copied by -ssc- as a file and put in the
same directory as the .ado and .hlp.

2. Your Windows 7 is 32 bit not 64 bit just in case that is a problem.

Nick

On Sat, Apr 16, 2011 at 9:14 PM, J Taylor <[email protected]> wrote:
> Thank you very much for the help with this. Following Joerg's
> suggestion, I did indeed delete all matwrite files manually.
> However, I still receive an error:
>
> ------------------------------------------
> . ssc install matwrite
> checking matwrite consistency and verifying not already installed...
> installing into c:\ado\plus\...
> installation complete.
>
> . clear
>
> . set obs 5000
> obs was 0, now 5000
>
> . set seed 1234
>
> . gen x = uniform()
>
> . gen y = 2*x + invnormal(uniform())
>
> . matwrite x y using c:\matlabfile, replace
> unrecognized command
> r(199);
> ------------------------------------------
>
> I am running Windows 7.  Ado files can be found on my computer in two locations:
> C:\ado
> C:\Program Files (x86)\ado
>
> It seems that the base Stata files were installed in C:\Program Files
> (x86)\ado, whereas  Updates are installed in C:\ado.  I have installed
> user-written commands a good number of times in the past.  I use ssc
> install (if it is available) or I copy and paste the ado file into
> Notepad, and then save the file as "Filename.ado" in C:\ado\plus\.
>
> Doing some Google searches, I saw it suggested to use the "which"
> command to see where the ado file is being called from (perhaps this
> speaks to Daniel's suggestion about matwrite not being on the path or
> not having read/write privileges)
> http://www.stata.com/support/faqs/lang/adopath.html
>
> . which matwrite
> c:\ado\plus\m\matwrite.ado
> *! matwrite version 0.90, 15/12/04, (c) Andrew Shephard
> . which regress
> C:\Program Files (x86)\ado\updates\r\regress.ado
> *! version 1.2.7  02oct2009
> . which reg_ress
> command reg_ress not found as either built-in or ado-file
> r(111);
>
> This is perhaps a rather mundane question, but does anyone have a
> sense of why I am still experiencing these problems?  Did I rule out
> the suggestion about matwrite not being on the path or not having
> read/write privileges through the "which" commands above?
>
> Thanks,
> JT
>
> On Fri, Apr 15, 2011 at 6:36 PM, Joerg Luedicke
> <[email protected]> wrote:
>> On Fri, Apr 15, 2011 at 2:58 AM, J Taylor <[email protected]> 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index