I have a variable "variant" that takes the following values: 1, 2, 3, 4, 5 and 6.
What I need to do, is a new variable called amistad
that takes value 1 for the cases in which the variante
takes value 1, 3, 5 and that takes value 2 for the cases in which variante
takes value 2, 4 and 6.
Try the following loop:
amistad= amistad(296,1)
for i=1:296
i= variante
if i== 1||3||5
amistad(i) = 1
if i == 2||4||6
amistad(i)= 2
end
But at no time I create the variable amistad
and I do not know if this is the right way to do it.