Help plotting some data?

There are 3 sets of data. Each set of data has 5 columns (16 rows 5 columns). Column 1 is Day column 2 is bacteria counts. How would you plot the day vs the bacteria counts for all three sets of data? On one graph

2 comentarios

Ben11
Ben11 el 25 de Jun. de 2014
What is in the last 3 columns for each data set?
José-Luis
José-Luis el 25 de Jun. de 2014
doc hold
doc plot

Respuestas (1)

dpb
dpb el 25 de Jun. de 2014

1 voto

... plot the day vs the bacteria counts...
Day vs counts or counts vs days???
Either way, simply either
a) read first, plot b) set
hold on
c) read second, plot; rinse and repeat.
Fix up colors, etc., as desired.
Alternatively, read the three files and save the data
x=zeros(16,3); % preallocate; I used the known sizes; these
y=x; % can be determined programmatically of course
d=dir('*.dat');
for i=1:length(d)
z=textread(d(i).name);
x(:,i)=z(:,1); % create x, y arrays
y(:,i)=z(:,2);
end
plot(x,y) % plot 'em all...
I presumed the day was independent here; if really want t'other way 'round, reverse x,y

La pregunta está cerrada.

Etiquetas

Preguntada:

el 25 de Jun. de 2014

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by