Grouped Frequency Distributions - MATLAB Cody - MATLAB Central

Problem 46657. Grouped Frequency Distributions

Difficulty:Rate
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

42.86% Correct | 57.14% Incorrect
Last Solution submitted on Nov 08, 2024

Problem Comments

Solution Comments

Show comments
Join Cody Contest 2025 — Have Fun and Win Prizes!
...
We’re excited to invite you to Cody Contest 2025! 🎉 Pick a team,...
Dive Into Hands-On Learning at MATLAB EXPO 2025 – Register Now!
Get ready to roll up your sleeves at MATLAB EXPO 2025 –...
0

Problem Recent Solvers8

Suggested Problems

More from this Author92

Community Treasure Hunt

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

Start Hunting!