How can I avoid having data proccesed in MATLAB with dots? I have to transfer the data to excel and manually replace later with commas.

How can I avoid having data proccesed in MATLAB with dots? I have to transfer the data to excel and manually replace later with commas. Is there an option for MATLAB to deliver me the data with commas already?

댓글 수: 1

Do you mean ',' for decimal point instead of the US '.'?
AFAIK there's no way to use the comma as a decimal separator inside Matlab, you could do a string substitution and write a file using them, however. It would require making the substitution on an internal write in memory and then writing the string to the file, however; there's no facility to use the ',' as the decimal point automagically.

댓글을 달려면 로그인하십시오.

답변 (2개)

Wayne King
Wayne King 2013년 11월 26일
편집: Wayne King 2013년 11월 26일
When you say "dots" do you the decimal point? Why can't Excel handle a decimal point?
If it's a matter of replacing a decimal point with a comma, you can do that after converting the number to a string.
x = 2.31;
strrep(num2str(x),'.',',')
If I've misunderstood your question, can you clarify?
a=rand(10,2) % example
b=strrep(arrayfun(@num2str,a,'un',0),'.',',')
xlswrite('file50.xls',b)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2013년 11월 26일

답변:

2013년 11월 26일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by