You can do the replacement using logical indexing. The replacement for 34 --> 1 would be as follows:
for i=2:3
idx = (mat(:,i) == 34);
mat(idx,i) = 1;
end
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!