octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Octave gets it right, Matlab gets it wrong, but wait ...


From: Tom Holroyd
Subject: Octave gets it right, Matlab gets it wrong, but wait ...
Date: Thu, 17 Jan 2008 11:02:47 -0500

OK, I greatly enjoyed debugging something recently where I found that
Octave 3.0 did the right thing and Matlab was doing it wrong.
Specifically, with recent Matlab,

    x = fread(fid, 32, 'char')';

reads 64 bytes. In my code, I it changed to:

    x = fread(fid, 32, 'uchar')';

and this read 32 bytes in both Octave 3.0 and Matlab 7.2. For more, see

http://www.mathworks.com/support/solutions/data/1-2782ZU.html?
solution=1-2782ZU

The issue is that 'char' is a 16 bit quantity in newer Matlab.

I really hate that they have made this change. It breaks existing code.

What will Octave do? I can see the point that you need a wide type to
handle Unicode, but I don't think that changing the definition of 'char'
is the right way to do it.

Is Octave going to track this sort of stupidity? Perhaps there could be
an option "Full on Matlab Brokenness". I really would be sad if Octave
changed 'char' to 16 bits.

Dr. Tom
--
>From you would he learn his belief in himself; he feeds upon your
glances, he eats praise out of your hands. Thus spoke Zarathustra.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]