This is probably a basic question, but i cant figure out from tutorials my where is my error. I have a function that should return 2 objects, a matrix and a vector. I tried to use structure for it, in this way:
structure mystr {
real matrix points
real colvector weights
}
structure mystr scalar myfcn(real scalar n,
| real scalar pr)
{
structure strres scalar mgh
... i compute matrix(called points) and vector(called weights)
mgh.points = points
mgh.weights = weights
return(mgh)
}
When i run it i get error at the very beginning:
: structure mystr {
invalid expression
(153 lines skipped)
What am i doing wrong? Thanks for help
structure mystr {
real matrix points
real colvector weights
}
structure mystr scalar myfcn(real scalar n,
| real scalar pr)
{
structure strres scalar mgh
... i compute matrix(called points) and vector(called weights)
mgh.points = points
mgh.weights = weights
return(mgh)
}
When i run it i get error at the very beginning:
: structure mystr {
invalid expression
(153 lines skipped)
What am i doing wrong? Thanks for help
Comment