Hi,
I have a 46×5 matrix with measurement data from 46 points taken on five days, called MyData.
The 46 measurement points belong to three groups. They are saved in a 46×1 vector called Site, with values 1, 2 or 3 representing the three groups.
I'm trying to create a grouped boxplot using:
MyData = rand(46,5);Site = randi([1 3],46,1);boxplot(MyData,Site);
but I'm getting an error:
Error using boxplot>straightenX (line 970)G must be the same length as X or the same length as the number of columns in X.Error in boxplot (line 274)[xDat,gDat,origRow,xlen,gexplicit,origInd,origNumXCols] = straightenX(x,g);
G and X actually do have the same length (46), but I assume Matlab doesn't like the fact that the number of columns in X is larger than one.
Does any of you know how to solve it? My goal is to make a boxplot similar to this (just made in Powerpoint:)
Best Answer