Help in using @recode and @nan for matrix
Posted: Mon Mar 19, 2018 9:26 am
Hi,
I have been using this code to find the maximum length, minimum or average length of a period.
However, instead of using series, I would like to use matrix to generate signal.
Can anyone know how to convert this code for matrix.
if @isobject("signal_"+%a+"_"+%s+"_"+%y+"_"+%x+"_"+%i)=1 then
SMPL IF signal_{%a}_{%s}_{%y}_{%x}_{%i} > 0
series tmplong_{%a}_{%s}_{%y}_{%x}_{%i} =1
tmplong_{%a}_{%s}_{%y}_{%x}_{%i} = @recode( tmplong_{%a}_{%s}_{%y}_{%x}_{%i}>0, @nan(tmplong_{%a}_{%s}_{%y}_{%x}_{%i}(-1),0 )+1,tmplong_{%a}_{%s}_{%y}_{%x}_{%i})
tmplong_{%a}_{%s}_{%y}_{%x}_{%i} = @recode( tmplong_{%a}_{%s}_{%y}_{%x}_{%i}>0 and @nan(tmplong_{%a}_{%s}_{%y}_{%x}_{%i}(1),0 )>0,0,tmplong_{%a}_{%s}_{%y}_{%x}_{%i})
endif
I have been using this code to find the maximum length, minimum or average length of a period.
However, instead of using series, I would like to use matrix to generate signal.
Can anyone know how to convert this code for matrix.
if @isobject("signal_"+%a+"_"+%s+"_"+%y+"_"+%x+"_"+%i)=1 then
SMPL IF signal_{%a}_{%s}_{%y}_{%x}_{%i} > 0
series tmplong_{%a}_{%s}_{%y}_{%x}_{%i} =1
tmplong_{%a}_{%s}_{%y}_{%x}_{%i} = @recode( tmplong_{%a}_{%s}_{%y}_{%x}_{%i}>0, @nan(tmplong_{%a}_{%s}_{%y}_{%x}_{%i}(-1),0 )+1,tmplong_{%a}_{%s}_{%y}_{%x}_{%i})
tmplong_{%a}_{%s}_{%y}_{%x}_{%i} = @recode( tmplong_{%a}_{%s}_{%y}_{%x}_{%i}>0 and @nan(tmplong_{%a}_{%s}_{%y}_{%x}_{%i}(1),0 )>0,0,tmplong_{%a}_{%s}_{%y}_{%x}_{%i})
endif