Announcement

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

  • matlist and rspec

    Is there a way to use a local macro to specify the number of rows when displaying a matrix using matlist and rspec option?
    For example, instead of
    Code:
    matlist Stats, rowtitle(Variables) cspec(o2& %24s | %9.0f & %9.2f & %9.2f o2&) rspec(&-&&&&&&&&&&&)
    using a local macro to specify the number (11 in this case) of "&"s following the line separator in the rspec option?

  • #2
    Code:
    . local n 11
    
    . local ands = `n'*"&"
    
    . local rs r-`ands'
    
    . display "rspec(`rs')"
    rspec(r-&&&&&&&&&&&)

    Comment


    • #3
      You could also use the extend function display. William's approach is more general, though.

      Code:
      local n 11
      local rspec : display "rspec(r-" _dup(`n') "&" ")"
      Best
      Daniel

      Comment


      • #4
        Thank you William and Daniel. It works!

        Comment

        Working...
        X