Scatterplot from .mat file data with loop
이전 댓글 표시
How do I make a scatter plot from a .mat file that looks like this? 

I have a .mat file with data from 15 petri dish colonies. Each column has 10 days of population data. There are 15 rows. I need each dish to plot its points vertically and then draw a line with thickness 3 that is the average of the days. I have been told to use a loop but I'm completely stuck on even starting.
답변 (2개)
Star Strider
2020년 10월 31일
Try something like this:
Colonies = rand(15,10); %Days = 15, Colonies = 10
MeanColonies = mean(Colonies,2);
Days = 1:15;
figure
plot(Days, Colonies, 'p')
hold on
plot(Days, MeanColonies, 'LineWidth',2)
hold off
.
A = rand(15,8) ; % random data for demo
[m,n] = size(A) ;
% Get mean
M = mean(A) ;
X = repmat(1:n,m,1) ;
scatter(X(:),A(:),[],A(:))
hold on
plot(1:n,M,'k')
카테고리
도움말 센터 및 File Exchange에서 Box Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!