How to boxplot cell array with different length in a single figure
Show older comments
%%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
Philipp Fischer
on 9 Aug 2016
Answers (0)
Categories
Find more on Box Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!