Bug in max function?
Mostrar comentarios más antiguos
The max function in Matlab gives unexpected results.
When I type
max(double(1000), uint8(1))
matlab gives the result
ans = 255
It looks like the double is silently converted to an uint8, which in that case would have the value 255, and is thus returned as the maximum. It seems more sensible to me to automatically convert all numbers to the largest number class.
Is this a bug or is this behaviour documented somewhere?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Time Series Events en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!