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   J Taylor <[email protected]>
To   [email protected]
Subject   Re: st: Problem Using Matwrite, "unrecognized command" error
Date   Sun, 17 Apr 2011 23:08:57 -0700

Thanks a lot.  I really appreciate your help.

Indeed, the matwrite.plugin was not copied into c:\ado\plus\m.

How might I obtain the plugin?  I know almost nothing about how
plug-ins work.  Consider the Matwrite program listed on the IDEAS
page:

http://ideas.repec.org/c/boc/bocode/s448301.html

Is matwrite.win32 the plugin (following Nick's email, I was thinking
that the plug-in should end in .plugin)?  I copied matwrite.win32
along with the other .ado and .hlp files into C:\ado\plus\m and
C:\Program Files (x86)\ado\updates\m, and am still experiencing the
error
. matwrite x y using c:\matlabfile, replace
unrecognized command

My Windows 7 is 64 bit.  However, I was under the impression that this
was fully compatible with Stata.  The main Stata ado files are
installed in C:\Program Files (x86), where Program Files (x86) is the
place where one is supposed to store 32 programs.

http://answers.microsoft.com/en-us/windows/forum/windows_vista-windows_programs/program-files-x86-and-program-files/b71d79fe-cd9c-4a23-a114-aa397946d621

Thank you,
JT



On Sun, Apr 17, 2011 at 1:29 AM, Nick Cox <[email protected]> wrote:
> 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/
>

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