I have an array of 90872×2 double. As follows:
A= B=
1 2
1 2
1 2
1 1
1 1
1 1
1 1
2 1
2 1
2 1
2 1
1 2
1 2
1 2
1 2
1 1
1 1
1 1
2 2
2 2
I want to create a column C with the following values accordinf to the following conditions:
1= when A==1 and B==1;
2= when A==1 and B==2;
3= when A==2 and B==1;
4= when A==2 and B==2;
Therefore I will have:
A= B= C=
1 2 2
1 2 2
1 2 2
1 1 1
1 1 1
1 1 1
1 1 1
2 1 3
2 1 3
2 1 3
2 1 3
1 2 2
1 2 2
1 2 2
1 2 2
1 1 1
1 1 1
1 1 1
2 2 4
2 2 4
any help?
Best Answer