Hi James,
As per my understanding, you are trying to indicate the moves of the player and the computer alternatively according to the number they have chosen. This can be done by reverse calculating the values of "xt" and "yt" from a given number present in the board. You can consider the following example:
Create a utility function that returns the value of "xt" and "yt" for both the boards according to an input argument. Here "boardType = 0" indicates your board and "boardType = 1" indicates the computer's board. This value can be changed according to the requirement.
function [xt, yt] = getPosition(inputNumber, numSpaces, boardType)
rowVal = floor((inputNumber-1)/numSpaces)+1; % Find out the value of the row
colVal = mod(inputNumber,numSpaces); % Find out the value of the column
if colVal == 0 colVal = 6; end % Modify column value to 6 if it is 0
% Swap the values if the board is for the computer
if boardType == 1
temp = rowVal;
rowVal = colVal;
colVal = temp;
end
xt = rowVal+0.5; % Calculate xt
yt = numSpaces-colVal+1.5; % Calculate yt
end
This function can be called to calculate the "xt" and "yt" values each time you want to change the colour. Now you can choose the subplot according to the requirement and use the "text" function to change the colour of the font. Here are some examples:
inputNumber = 36;
[xt, yt] = getPosition(inputNumber,numSpaces,0); % For your board
subplot(1,2,1) % Select the corresponding subplot
text(xt, yt, sprintf('%d',inputNumber) , 'Color', 'b', 'FontSize', 8, 'FontWeight','bold', 'HorizontalAlignment','center')
inputNumber = 17;
[xt, yt] = getPosition(inputNumber,numSpaces,1); % For computer's board
subplot(1,2,2) % Select the corresponding subplot
text(xt, yt, sprintf('%d',inputNumber), 'Color', 'g', 'FontSize', 8, 'FontWeight','bold', 'HorizontalAlignment','center')
The above code gives the following result:

I hope this helps!