Why does MATLAB return a number with a comma as a decimal point?
2 ビュー (過去 30 日間)
古いコメントを表示
Why does MATLAB return a number with a comma as a decimal point?
My Window's Regional and Language Setting is set to an area where the decimal point is represented as a comma. Why does MATLAB return numbers with a decimal comma, but when I try to use this number in another function, I get an error.
To see the bug, go to Windows' Control Panel -> Regional Options
and switch your system to a locale with a decimal comma.
Then start MATLAB and issue the command:
plot(1)
Now, hit the 'Show Plot Tools' button. When the tools are up, click on an axis of the figure, such that the bottom section of the figure showsthe 'Property Editor - Axes'. Type a fractional limit for X, Y, or Z axis and click anywhere outside the edit field to make the input active. The decimal point in the input field is replaced by a comma.
Since MATLAB does not use the decimal comma, an error dialog box opens when the limit is changed without replacing the comma by a point. When used as an argument in another function, this causes an error.
採用された回答
MathWorks Support Team
2009 年 6 月 27 日
This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
This is a bug in MATLAB. MATLAB uses the underlying Windows Language Settings for outputting answers, which could be set to one of the languages that use commas to symbolize a decimal. However, it does not recognize this as a proper number when it is used in a function call.
As a workaround, the user can just replace the comma with a point.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Dialog Boxes についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!