Why does the NUMEL function give an incorrect answer for a uint8 datatype, when run in my script in MATLAB 6.5.1 (R13SP1)?
Show older comments
When I execute the following code I receive the incorrect output value for "a" shown below:
data=uint8(randn(245,352,11))
data_whos = whos( 'data' )
a= numel(data)
data_whos =
name: 'data'
size: [245 352 11]
bytes: 948640
class: 'uint8'
a =
86240
The correct value of "a" should be 245 x 352 x 11=948640.
However, when I run the code through the MATLAB debugger I get the correct answer.
Accepted Answer
More Answers (0)
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!