octave-maintainers
[Top][All Lists]
Advanced

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

Re: type handling bug?


From: Søren Hauberg
Subject: Re: type handling bug?
Date: Tue, 26 May 2009 12:50:24 +0200

tir, 26 05 2009 kl. 12:15 +0200, skrev Levente Torok:
[snip]
> listing the two vectors together as
> [ [1:s]' z ]

Here 's' is a 'double' and 'z' is 'uint8'. In matlab, when you concat a
double and an uint8 you get an uint8. In Matlab 7.6 I see:

        >> class ([uint8(1), double(1)])
        
        ans =
        
        uint8

So, this behaviour is compatible. My guess is that people mostly use the
integer classes to save memory, so Matlab downgrades other types to
integers when in doubt, to make sure that memory usage doesn't blow up.

Soren



reply via email to

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