You are given an array containing the number of students in various academic departments of a university, along with a parallel cell array of the department names.
Write a MATLAB function that analyzes this data using vectorization techniques. The function must return 5 numeric/text outputs and generate a bar plot.
Your function should calculate and return:
- top_dept: The name of the department with the highest number of students (if there is a tie, return the first one).
- total_students: The total number of students in the entire university.
- total_depts: The total number of departments.
- me_students: The number of students specifically in the 'ME' department.
- dept_55_students: The name of the department(s) that has exactly 55 students. (Return as a string or cell array).
Additionally, the function must display a bar plot of the student data with the department names labeled on the X-axis.
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers3
Suggested Problems
More from this Author18
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!