Determine integers in an array and show the results
Mostrar comentarios más antiguos
Hello, my friends
New to Matlab user
Let's say I want to determine the integers in x=[1 2.5 3.6 4] and get the result x_int=[1 4]. How can I do it?
Thank you
Respuesta aceptada
Más respuestas (2)
Walter Roberson
el 18 de Nov. de 2016
0 votos
Integral have several properties that can be tested:
- round() and floor() and ceil() and fix() of the value equals the value itself
- mod() of the value with 1 equals 0
rbarata
el 18 de Nov. de 2016
0 votos
1 comentario
Walter Roberson
el 18 de Nov. de 2016
Please use the "Comment on this Answer" buttons instead of adding a new Answer each time.
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!