How to append new data to a box and whisker plot
2 次查看(过去 30 天)
显示 更早的评论
Hello!
I have 3 seperate "***_01.mat" files, each with a vector with the same name, 'v', which contains an series of numbers. If I type the following, I get a single boxplot
plot(v{1})l
I need to grab the first .m file, '***_01.mat', extract the 'v' variable, and plot it in the box plot with the x-axis label '1'
then, i need to clear 'v'. Then load the 'v' variable from ***_02.mat, and plot it in the box plot with the x-axis label '2'.
This would need to go onto set 3
How would I go about this?\
Thanks!
0 个评论
回答(1 个)
dpb
2019-9-27
d=dir('*_01.mat');
v=[];
for i=1:length(d)
V=[v load(d(i).name)];
end
V=cell2mat(V);
boxplot(V)
from what you've told us and some guesses as to what might be true about what you didn't...
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!