Hello Matt,
To replace values in multiple columns of a table in MATLAB, you can loop through each column and apply the same logic.
% Convert the matrix to a table
T = array2table(T);
% Loop through each column of the table
for col = 1:width(T)
for i = 1:height(T)
if T{i, col} == 5
T{i, col} = Y(mod(i,width(X)));
end
end
end
Hope it helps!