# Problem 46657. Grouped Frequency Distributions

One input is a dataset. The other input is the number of groups (classes). Create grouped frequency distribution by following steps:
dataset = [20,25,35,40,20,14,16,15,14,16,13,10,23,28,29,30,34,32,14,17,11,10,7,5,2,7,7];
numClass = 4;
• Find the range: max - min. range = 40 - 2 = 38
• Find the group (class) width by dividing the range by the number of groups. Round up if the width has decimal point. 38/4 = 9.5. round up. width = 10
• Start with the minimum value of the dataset and add class width.
2 12
12 22
22 32
32 42
• Count the number of occurrences in each group. For the first class you will count occurences greater than or equal to 2 and less than 12. For the second class you will count occurences greater than or equal to 12 and less than 22 and so on.
groups frequency
2 12 8
12 22 10
22 32 5
32 42 4

### Solution Stats

40.0% Correct | 60.0% Incorrect
Last Solution submitted on Feb 08, 2024

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!