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