Use strrep
-
%%// input_filepath and output_filepath are the filepaths of the
%%// input and output tex files
data = importdata(input_filepath);
datacell = strrep(data,',',';');
%%// Save as a text file
fid2 = fopen(output_filepath,'w');
for k = 1:size(datacell,1)
fprintf(fid2,'%s\n',datacell{k,:});
end
fclose(fid2);