How can I extract noninteger elements from an array using Ma
How can I extract non-integer elements from an array using Matlab? What I am trying to do is to extract numbers that are between the values of 0.8 and 0.9 from a column that has over 3000 values but Matlab keep rounding the values when I input the following command in the command window:
disp((y>=0.8 & y<=0.9));
The command keeps showing zeros and ones (0\'s & 1\'s). I\'m assuming the numbers are being rounded.
P.S.:
y=[1, 0.875, 082, 0.9, 0.84, 0.8573, 1]
Solution
Now here the zeros and ones are to represent whether the number satisfies the given condition
i.e., 1 if condition satisfied
0 if condition is not satisfied..
consider given
y=[1, 0.875, 082, 0.9, 0.84, 0.8573, 1]
disp( y >= 0.8 & y <= 0.9)
0 1 0 1 1 1 0
% here 1 does not satisfies the given condition hence 0 is given as result
% here 0.875 satisfies the given condition hence 1 is given as result
