Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在matlab中有多个方框图_Matlab_Boxplot - Fatal编程技术网

在matlab中有多个方框图

在matlab中有多个方框图,matlab,boxplot,Matlab,Boxplot,我在matlab中有两个箱线图,如下所示: boxplot(input1(:,2), input1(:,1)) % time accompilishing a task among genders (male/female) boxplot(input2(:,2), input2(:,1)) % time accompilishing a task among degree (bachelor/master) 我想要的是在同一个绘图中完成两个图表。因此,对于x轴上的四种情况,时间在y轴上。我如

我在matlab中有两个箱线图,如下所示:

boxplot(input1(:,2), input1(:,1)) % time accompilishing a task among genders (male/female)
boxplot(input2(:,2), input2(:,1)) % time accompilishing a task among degree (bachelor/master)

我想要的是在同一个绘图中完成两个图表。因此,对于x轴上的四种情况,时间在y轴上。我如何才能做到这一点?

您可以通过简单地垂直连接表来解决这一问题:

input = [input1;input2];
boxplot(input(:,2), input(:,1))

这是假设input1中的组与input2中的组具有不同的键。例如,如果男=1,女=2,学士=1,硕士=2,它将混合课程而不会抛出错误。在这种情况下,您必须事先指定唯一键。

有关更高级的选项,您可能需要查看