Could someone please help me with my boxplot?
1 view (last 30 days)
Show older comments
I am told to graph box plots of "total alarm use" by gender.
The variable useAlarm has the data for the number of times an alarm was used in order to wake up and is (21x144 logical).
In order to separate the data by gender I typed this into matlab:
men = strcmp(gender, 'male');
totalmen = sum(men);
alarmmen = useAlarm(:, men);
women = strcmp(gender, 'women);
totalwomen = sum(women);
alarmwomen = useAlarm(:, women);
Then, I set up an "alarm" variable to place it in the graph:
alarm = useAarm([alarmmen, alarmwomen}], gender);
which keeps saying "error"
Now, I think to plot the boxplots all I have to type in is:
figure
boxplot(alarm, gender);
ylabel('Number of times alarm was used')
title('Comparison of alarm use by gender')
Could someone please help me figure out how I am suppose to use my "alarm" variable in order to plot the boxplot?
Thank you, I appreciate the help.
0 Comments
Answers (1)
BhaTTa
on 10 Sep 2024
@Student, the error you see here is because there is a typo in your alarm variable definition (useAarm should be useAlarm).
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!