Why does using a comma as my decimal separator cause MATLAB to crash and affect my graphics?

2 visualizaciones (últimos 30 días)
If I use a semicolon as my decimal separator it causes MATLAB to crash and affect my graphics. Using the DEMO command can also cause a segmentation violation in this case.
In a crashing MATLAB, typing:
a = 1.2
gives
a = 1
Typing:
a = 12/10
gives
a = 1,2
Note that MATLAB in the second case answered with a comma (,) instead of a period (.).
When I run DEMO after installing on a UNIX platform, I may also receive the following error message:
-----------------------------------------------------------------------
Segmentation violation detected at Wed May 19 15:15:34 1999
------------------------------------------------------------------------
Configuration:
MATLAB Version: 5.3.0.10183 (R11)
Operating System: SunOS 5.5.1 Generic sun4m
Window System: Sun Microsystems, Inc. (3510), display :0.0
Current Visual: 0x22 (class 3, depth 8)
In Sweden and other countries, we use commas (,) instead of periods (.) in numbers.
On all computers, on which I have the new printer drivers on the default printer, if I have a comma (,) as the decimal symbol, MATLAB will crash. If I have a period (.) as the decimal symbol, MATLAB will work.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 27 de Jun. de 2009
For PC:
In order to work around this issue, use the period as the decimal separator. You can change this by using the following the steps:
1. Click on the Start button
2. Choose Settings -> Control Panel
3. Choose Regional Settings
4. Choose the "Number" tab
5. Change the Decimal Symbol to a period
6. Click Apply
For UNIX:
To work around this, you will need to set your system to use the period as the decimal separator. The best way is to use
setenv LC_NUMERIC C
or
LC_NUMERIC=C (if you are using a bsh)
in the shell before running MATLAB. This is a POSIX standard so it works on all machines.
For additional assistance with this, contact your system administrator.

Más respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by