I have the following array.
R = [ 1 2 0 1 0 2]
if values in R = 0 I want to replace it with 3, so I did
If R == 0R = 3end
So it should end up
R = [ 1 2 3 1 3 2]
However as you probably know, this does not work. How do I make this work? Thanks! Same problem with the following:
P = [ 1 2 3 4 5]Q = [ 5 4 3 2 5]
I want to find positions where P == Q so I tried
if P == QQ = 6end
ie all positions where P = Q change to 6 so it should end up with
Q = [ 5 4 6 2 6]
Best Answer