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
Star Strider 2020년 10월 31일

1 개 추천

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
.
KSSV
KSSV 2020년 10월 31일
편집: KSSV 2020년 10월 31일

0 개 추천

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')

제품

릴리스

R2020a

질문:

2020년 10월 31일

편집:

2020년 10월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by