Loops to determine what is in certain ranges from data
Show older comments
Hi, so I have a set of data and I'm trying to use loops to determine what data lies between ranges of increments of 10 from 0 (ie 0 <=10) and so on. I've been trying to use for loops for each of the ranges and insert each one into a column vector, but it doesn't seem to work. I'm very new to matlab so any help is greatly appreciated!
Accepted Answer
More Answers (1)
Stephen23
on 12 Feb 2017
MATLAB code should be beautiful, and using loops is not very beautiful. Perhaps something like this might work for you:
>> X = randi(99,9,4)
X =
24 1 34 79
53 54 83 74
6 21 55 13
75 22 95 82
60 33 89 3
85 10 36 42
98 75 55 73
93 75 35 78
41 54 62 37
>> floor(X/10)
ans =
2 0 3 7
5 5 8 7
0 2 5 1
7 2 9 8
6 3 8 0
8 1 3 4
9 7 5 7
9 7 3 7
4 5 6 3
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!