Could someone please help me with my boxplot?

1 visualización (últimos 30 días)
Student
Student el 12 de Abr. de 2016
Respondida: BhaTTa el 10 de Sept. de 2024
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.

Respuestas (1)

BhaTTa
BhaTTa el 10 de Sept. de 2024
@Student, the error you see here is because there is a typo in your alarm variable definition (useAarm should be useAlarm).

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by