How to append new data to a box and whisker plot

2 ビュー (過去 30 日間)
EL
EL 2019 年 9 月 21 日
回答済み: dpb 2019 年 9 月 27 日
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!

回答 (1 件)

dpb
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...

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by