Similar question to previous post, except it is a matrix.
Posted: Wed Oct 29, 2008 2:25 pm
I have a matrix A , what i want to do is if each factor is greater than 65, then matrix B= (factor-65), else factor returns 0.
I tried to create a new matrix S full of 65(same dimension as matrix A) and using code
matrix new_A = (A>65)*(A-65)+(A<=65)*0
However, it returns a matrix full of 0(@recode can't be used in matrix calculations).
Thank you!!!
I tried to create a new matrix S full of 65(same dimension as matrix A) and using code
matrix new_A = (A>65)*(A-65)+(A<=65)*0
However, it returns a matrix full of 0(@recode can't be used in matrix calculations).
Thank you!!!