Determine integers in an array and show the results
Show older comments
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
Accepted Answer
More Answers (2)
Walter Roberson
on 18 Nov 2016
0 votes
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
on 18 Nov 2016
0 votes
1 Comment
Walter Roberson
on 18 Nov 2016
Please use the "Comment on this Answer" buttons instead of adding a new Answer each time.
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!