I have one question regarding the mata programming. I couldn't figure out why mata reports an error "type mismatch: exp.exp: transmorphic found where struct expected" when it goes to codes
Code:
AA.aa = sum(A1.a)
Kind regards,
Yugen
Code:
mata: mata clear //------------------------------------------------- class Myclass1 { real vector a } class Myclass1 scalar myfct1 (real vector b) { class Myclass1 scalar A A.a = b return(A) } //------------------------------------------------- class Myclass2 { real scalar aa } class Myclass2 scalar myfct2 (real vector b) { class Myclass2 scalar AA A1=myfct1(b) AA.aa = sum(A1.a) return(AA) } end
0 Response to type mismatch error in declaring a function of a class
Post a Comment