log2() only works with double types?

1 view (last 30 days)
log2() seems to only work with 'double' types. It throws error when argument is int64.
num = 10000;
d = floor(num / 7);
a = log2(d);
d = int64(num / 7);
b = log2(double(d));
b = log2(d);
Check for incorrect argument data type or missing argument in call to function 'log2'.

Accepted Answer

Simon Chan
Simon Chan on 24 Oct 2021
Check MATLAB documentation and this fucntion log2 supports type single or double as the input argument type.
atharva aalok
atharva aalok on 24 Oct 2021
That was great help Steven! Thanks a ton!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!