Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem in Mata: namelist and wildcard

    Dear Statalist,

    I have a small, but curious problem when working (at beginner level) with Mata to which I cannot seem to find the solution:
    When I use the command "mata describe" the namelist that can optionally follow does (to my reading) not seem to work as described in the namelist entry in the Mata manual.

    Toy example:
    Code:
     
    
    mata
        mata clear
        A = J(5,5,5)
        B = J(1,1,1)
        A_hm = J(5,5,5)
        B_hm = J(1,1,1)
        Bx_hm = J(1,1,1)
           
        mata describe
        mata describe A_hm
        mata describe *
        mata describe A_*
        
        mata describe *_hm
        mata describe B*_hm
        
    end
    Why do the last two lines issue error r(198)? According to "help namelists" using * in this way should be possible. I guess I'm missing something very basic here.

  • #2
    First, I agree that mata describe does not work as advertised (on Stata 17, Win 10).

    Perhaps Mata has problems with interpreting the asterisk at the beginning because the asterisk is used to dereference pointers. However, if that was the root of the problem, we would expect a Mata traceback-log and return code > 3000, not the Stata error message that we see. This behavior is most likely not intended. I would ask tech support to comment on this.

    Comment


    • #3
      Using the other wildcard described in -help namelists-, "?" to indicate a single character, also returns an error.

      Comment


      • #4
        Tech support told me that mata describe (and others like mata drop I assume) currently only support wildcards at the end. The developers will consider changing this in future updates.

        Comment


        • #5
          Originally posted by Jonathan Deist View Post
          Tech support told me that mata describe (and others like mata drop I assume) currently only support wildcards at the end. The developers will consider changing this in future updates.
          Thanks for reporting back.

          Comment

          Working...
          X