How to boxplot cell array with different length in a single figure

%%This is what i found. But for my approach I am not able to group the data
ZellA= cell(1,2);
ZellA{1,1} = [1; 2; 3; 4 ];
ZellA{1,2} = [1; 2; 3];
if true
% code
end
G = [cell2mat(ZellA(1,1)); cell2mat(ZellA(1,2))]; % Grouping data
B = [ones(1,length(cell2mat(ZellA(1,1)))), ones(1,length(cell2mat(ZellA(1,2))))+1]
B = B(:)
figure;
boxplot(G,B);
%%My apporach
figure;
hold on;
for i = 1 : length(ZellA)
boxplot(cell2mat(ZellA(i)),i);
end

1 Comment

I solved the problem with the tab2box() function of: https://www.mathworks.com/matlabcentral/fileexchange/46545-alternative-box-plot

Sign in to comment.

Answers (0)

Asked:

on 8 Aug 2016

Commented:

on 9 Aug 2016

Community Treasure Hunt

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

Start Hunting!