Announcement

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

  • mata function in loop procedure

    Hello.

    I'm trying to make mata function in my loop procedure, and I wonder how to bring matrix to mata function.

    If I have A1, A2, A3, A4 matrix in stata space, and then I would like to make some calculation using those matrix through mata function.

    forvalues i=1/4 {

    mata
    function ss {
    kmat`i'=st_matrix("A"`i')

    }

    end.


    I would like to know how to convert A1-A4 matrix into mata.


  • #2
    Code:
    forvalues i=1/4 {
    mata: A`i' = st_matrix("A`i'")
    }


    Comment


    • #3
      Thanks a lot.

      Comment

      Working...
      X