[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with kron compatibility
From: |
Rik |
Subject: |
Re: Help with kron compatibility |
Date: |
Mon, 6 Aug 2018 13:16:04 -0700 |
On 08/06/2018 12:35 PM, Alois Schloegl wrote:
> On 2018-08-06 20:50, Rik wrote:
>> x = kron(uint8[2 3;4 5], ones(2,2,'uint8'));
>> class (x)
>> y = kron(uint8[2 3;4 5], ones(2,2,'int16'))
>> class (y)
>
> Dear Rik ,
>
>
> It seems there are some paranthesis missing, I guess you meant
>
> ...uint8([2 3;4 5])...
Oops, I was in a hurry and should have checked the code more carefully.
But yes, that was what I intended. It seems like kron does preserve the
class of the input in the output. If that is the case then mixed floating
point, integer cases probably result in an integer output. Could you try
this last test?
x = kron (uint8 ([2 3;4 5]), ones(2,2));
class (x)
I suspect it will be uint8 rather than double.
--Rik