About isinteger command(confusion)
Mostrar comentarios más antiguos
Hi, by the command of isinteger I can check if it is an integer, however, when defined at first, Matlab assume it is double precision right? So even a=3, isinteger(a) returns 0.
How to solve this problem?
Respuesta aceptada
Más respuestas (2)
Jan
el 16 de Mzo. de 2013
Joining the rounding with the checks for overflows:
function isf = isflint(m)
isf = (abs(m) <= bitmax && m == floor(m));
1 comentario
per isakson
el 18 de Mzo. de 2013
I'll replace my cryptic isflint.
ChristianW
el 14 de Mzo. de 2013
doc isinteger
isinteger(int8(3))
5 comentarios
C Zeng
el 15 de Mzo. de 2013
ChristianW
el 15 de Mzo. de 2013
isint = @(x) x==round(x)
C Zeng
el 16 de Mzo. de 2013
Jan
el 16 de Mzo. de 2013
@C Zeng: @(x) x==round(x) is an anonymous function. You find an exhaustive description ion the documentation.
C Zeng
el 17 de Mzo. de 2013
Categorías
Más información sobre Logical 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!