Matlab to other file dot transfer as comma??

at matlab for numbers 'dot' is used as a decimal symbol but when I try to paste this numbers to the other files (excel,text file) it turns automatically 'comma'. I did all other changes in windows but the problem results from matlab likely. How can I solve this comma dot confusion at matlab?

2 commentaires

Stephen23
Stephen23 le 5 Août 2016
Modifié(e) : Stephen23 le 5 Août 2016
@byzt3005: this likely has nothing to do with MATLAB, but depends on your Windows/Office/... settings. They will interpret a decimal values depending on your locale/language settings. It is possible to fiddle around and try to get everything to play nicely, but in my experience it always fails somewhere...
The most reliable solution is to install and use the US English version of Windows (and other programs), then this problem never arises. As most programming languages use US English this makes many things much simpler: e.g. the US keyboard layout is easier to write code with too.
What I did:
1-Control Panel -> Region and Language
2-[Formats] Choose Format: "English (United Kingdom)"
3-Restart computer
Note(s):
-Does not necessarily need to be "English (United Kingdom)", what matters is that in [Additional Settings (within [Formats])] the Decimal Symbol is set to "." (i.e. dot).

Connectez-vous pour commenter.

Réponses (2)

Gustav Karner
Gustav Karner le 14 Jan 2020

6 votes

Go to Preferences and chose Variables.
Change "Decimal separator for exporting numeric data via clipboard:" to a point.
Andreas Goser
Andreas Goser le 5 Août 2016
I tried the following
a=1.2
in MATLAB and then select and copy the "1.2" from the MATLAB R2016a command window.
Then I pasted into a Notepad file - > "1.2"
Then I pasted into a MS Excel file - > "01. Feb"
I assume this happens as of Excel interprets the string based on my language and local settings as a date. Maybe this happens to you to?

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by