I am writing an ado file and I use structures like:
program define XX, eclass
myfunction()
ereturn matrix V = `V'
end


mata:
myfunction(
calculate V
st_matrix(`V', v)
)
end

I use trace and it tells me that ereturn matrix V = __000003 invalid syntax
I use -ereturn post `V' before, but it gives back matrix __000003 not found. (but matrix V existed if I use matrix list V instead)
I think I already changed the calculated V into matrix in st_matrix. Do I need mat `V' = e (V) somewhere?

Thanks!