On Sat, 2 Jan 2021, Sven Schreiber wrote:
Perhaps we should add this to 'extra' as well?
Sure, why not. Here's a version that encompasses the present discussion:
<hansl>
function matrix Dup(const matrix A)
scalar m = rows(A)
if m <= 1
return A
else
catch H = unvech(seq(1,m)')
err = $error
errorif(err, errmsg(err))
ret = A[vec(H),]
return ret
endif
end function
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------