[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: st_subview() in Mata

From   Nguyen Cong Minh <>
Subject   st: st_subview() in Mata
Date   Sat, 11 Aug 2007 14:38:34 -0400

Hi Statalist,

I used some Mata functions, and used st_view() to get the matrix from data,
then use st_subview() to get a submatrix from that matrix.

------ Mata code -------

real matrix V, Yall, Xall
neq = st_local("neqn")
st_view(V,., tokens(varname))

It reported the error:
			mysub():  3250  type mismatch
                 <istmt>:     -  function returned error

I tried different ways, but not working also.
	Yall = V[|1,1 \ rows(V),neq|]
	Xall = V[|1,neq+1 \ rows(V), cols(V)|

This way also does not working

	for(i=1;i<=neq;i++) {
		Yall = Yall , V[.,i]	
	for(i=neq+1;i<=nrows;i++) {
		Xall = Xall , V[.,i]	

I don't know how to fix that problem. Anyone can help me out?

Thanks so much,

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index