Pregunta

I am creating a tex file in Matlab. The end goal is to create a pdf using latex. I have using following website to check the latex I have is correct latex generator. Everything is fine about from when I have a number that contains comma's for example 5,236,012. The issue comes when I copy the data from the tex file. The column delimiter is set to Commas, how can I change this to Semicolon?

¿Fue útil?

Solución

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);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top