[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with kron compatibility
From: |
Alois Schloegl |
Subject: |
Re: Help with kron compatibility |
Date: |
Mon, 6 Aug 2018 21:35:22 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
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])...
I checked R2018a, R2016b, R2013a, and the results are:
----------------
>> version
ans =
'9.4.0.813654 (R2018a)'
>> x = kron(uint8([2 3;4 5]), ones(2,2,'uint8'));
>> class (x)
ans =
'uint8'
>> y = kron(uint8([2 3;4 5]), ones(2,2,'int16'))
Error using .*
Integers can only be combined with integers of the same class, or scalar
doubles.
Error in kron (line 34)
K = reshape(A.*B,[ma*mb na*nb]);
>> class (y)
Undefined function or variable 'y'.
----------------
>> version
ans =
9.1.0.441655 (R2016b)
>> x = kron(uint8([2 3;4 5]), ones(2,2,'uint8'));
>> class (x)
ans =
uint8
>> y = kron(uint8([2 3;4 5]), ones(2,2,'int16'))
Error using .*
Integers can only be combined with integers of the same class, or scalar
doubles.
Error in kron (line 34)
K = reshape(A.*B,[ma*mb na*nb]);
>> class (y)
Undefined function or variable 'y'.
----------------
>> version
ans =
8.1.0.604 (R2013a)
>> x = kron(uint8([2 3;4 5]), ones(2,2,'uint8'));
>> class (x)
ans =
uint8
>> y = kron(uint8([2 3;4 5]), ones(2,2,'int16'))
Error using .*
Integers can only be combined with integers of the same class, or scalar
doubles.
Error in kron (line 34)
K = A(ia,ja).*B(ib,jb);
>> class (y)
Undefined function or variable 'y'.