Question
I have a matrix of occurences (7 rows(countries),46 columns(number of shoes)), n - number of occurences - for example in "a" I have n1=450, single pair of shoes... 1 2 3 .... 46 a n1 n2 n3 .... n46 b . . . g I would like to produce 7 boxplots representing the distribution in each category a-g. Normally I would have 450 times 1, n2 times 2 etc... is there a simple way to do it? Does anybody have a suggestion for a nicer representation than the boxplot?
Expert Answer
Neeta Dsouza
PhD Expert
Answered Sep 2, 2026
This may partially answer what you want. Step 1 would be to take the data for "a" and stretch it out as you describe. Here's one way to expand a data vector according to a vector of frequencies:
f = [4 3 0 1 2]; % frequencies d = [1 2 3 4 5]; % data c = [0, cumsum(f)]; % cumulative sum of frequencies x = zeros(1,c(end)); for j=1:length(c)-1 x(c(j)+1:c(j+1)) = d(j); % insert each value as required end
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related AI Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →