Page 1 of 1

How to create a matrix with Na and certain values as 0

Posted: Wed Jul 13, 2022 8:28 am
by lotusfr
For example, I have a M=8*8 matrix and I want the default to be NA. But M(1-4,5-8) as 0

Thanks very much

Re: How to create a matrix with Na and certain values as 0

Posted: Wed Jul 13, 2022 8:41 am
by EViews Gareth
Lots of different ways. Here's one:

Code: Select all

matrix(8,8) x x=na matplace(x,0*@ones(4,4),1,5)