Dear all,
a very very simple question on strings and if-then loops.
I loaded an xls file – 384X2 double – which only contains numbers. Let's call it B. I'm simply looking for matching numbers (n) in column 2 and replacing the correspondent value (m) in the correspondent cell in column 1. Replacing numbers with numbers, it works easily:
given n = 5 and m = 7
for i 1:384if B(i,2) == 5B(i,1) = 7endend
Now the question: what if I want to substitute the values in column 1 with a string – like "bob" or "whatever"? How would the loop look like?
for i 1:384if B(i,2) == 5B(i,1) = ???endend
Any help is highly appreciated.
Best,
Udiubu
Best Answer