I am very new to matlab and trying to learn how to code my project, any help would be much appreciated.
Currently, I am trying to code a script that if there is one number already avaliable at one column, it would put the other number in the other column. For example, I am trying to get number 0, 1 randomly coded in to column 2 and 3. If there is a 0 on column 2, I would like to have 1 on column 3 and vice versa. So it would look something like this.
I managed to get the 0 and 1 randomly distrbuted on column 2, but I am having trouble with putting the numbers in for column 3.
Would anyone know an effiecnt way to do it?
Below is the code that I was trying to use.
Datafile(:,2) = mod(reshape(randperm(96*1), 96, 1), 2)